Class: HookSniff::Models::DeliveryAttempt
- Inherits:
-
Object
- Object
- HookSniff::Models::DeliveryAttempt
- Defined in:
- lib/hooksniff/models.rb
Instance Attribute Summary collapse
-
#attempt_number ⇒ Object
readonly
Returns the value of attribute attempt_number.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#duration_ms ⇒ Object
readonly
Returns the value of attribute duration_ms.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(data) ⇒ DeliveryAttempt
constructor
A new instance of DeliveryAttempt.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ DeliveryAttempt
Returns a new instance of DeliveryAttempt.
80 81 82 83 84 85 86 87 88 |
# File 'lib/hooksniff/models.rb', line 80 def initialize(data) @id = data["id"] @attempt_number = data["attempt_number"] @status_code = data["status_code"] @response_body = data["response_body"] @duration_ms = data["duration_ms"] @error_message = data["error_message"] @created_at = data["created_at"] end |
Instance Attribute Details
#attempt_number ⇒ Object (readonly)
Returns the value of attribute attempt_number.
78 79 80 |
# File 'lib/hooksniff/models.rb', line 78 def attempt_number @attempt_number end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
78 79 80 |
# File 'lib/hooksniff/models.rb', line 78 def created_at @created_at end |
#duration_ms ⇒ Object (readonly)
Returns the value of attribute duration_ms.
78 79 80 |
# File 'lib/hooksniff/models.rb', line 78 def duration_ms @duration_ms end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
78 79 80 |
# File 'lib/hooksniff/models.rb', line 78 def @error_message end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
78 79 80 |
# File 'lib/hooksniff/models.rb', line 78 def id @id end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
78 79 80 |
# File 'lib/hooksniff/models.rb', line 78 def response_body @response_body end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
78 79 80 |
# File 'lib/hooksniff/models.rb', line 78 def status_code @status_code end |
Instance Method Details
#to_h ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/hooksniff/models.rb', line 90 def to_h { id: @id, attempt_number: @attempt_number, status_code: @status_code, response_body: @response_body, duration_ms: @duration_ms, error_message: @error_message, created_at: @created_at } end |