Class: HookSniff::Models::Delivery
- Inherits:
-
Object
- Object
- HookSniff::Models::Delivery
- Defined in:
- lib/hooksniff/models.rb
Instance Attribute Summary collapse
-
#attempt_count ⇒ Object
readonly
Returns the value of attribute attempt_count.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#endpoint_id ⇒ Object
readonly
Returns the value of attribute endpoint_id.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#replay_count ⇒ Object
readonly
Returns the value of attribute replay_count.
-
#response_status ⇒ Object
readonly
Returns the value of attribute response_status.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(data) ⇒ Delivery
constructor
A new instance of Delivery.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ Delivery
Returns a new instance of Delivery.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/hooksniff/models.rb', line 52 def initialize(data) @id = data["id"] @endpoint_id = data["endpoint_id"] @event = data["event"] @status = data["status"] @attempt_count = data["attempt_count"] || 0 @response_status = data["response_status"] @replay_count = data["replay_count"] || 0 @created_at = data["created_at"] end |
Instance Attribute Details
#attempt_count ⇒ Object (readonly)
Returns the value of attribute attempt_count.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def attempt_count @attempt_count end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def created_at @created_at end |
#endpoint_id ⇒ Object (readonly)
Returns the value of attribute endpoint_id.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def endpoint_id @endpoint_id end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def event @event end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def id @id end |
#replay_count ⇒ Object (readonly)
Returns the value of attribute replay_count.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def replay_count @replay_count end |
#response_status ⇒ Object (readonly)
Returns the value of attribute response_status.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def response_status @response_status end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
50 51 52 |
# File 'lib/hooksniff/models.rb', line 50 def status @status end |
Instance Method Details
#to_h ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/hooksniff/models.rb', line 63 def to_h { id: @id, endpoint_id: @endpoint_id, event: @event, status: @status, attempt_count: @attempt_count, response_status: @response_status, replay_count: @replay_count, created_at: @created_at } end |