Class: HookSniff::Models::Delivery

Inherits:
Object
  • Object
show all
Defined in:
lib/hooksniff/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_countObject (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_atObject (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_idObject (readonly)

Returns the value of attribute endpoint_id.



50
51
52
# File 'lib/hooksniff/models.rb', line 50

def endpoint_id
  @endpoint_id
end

#eventObject (readonly)

Returns the value of attribute event.



50
51
52
# File 'lib/hooksniff/models.rb', line 50

def event
  @event
end

#idObject (readonly)

Returns the value of attribute id.



50
51
52
# File 'lib/hooksniff/models.rb', line 50

def id
  @id
end

#replay_countObject (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_statusObject (readonly)

Returns the value of attribute response_status.



50
51
52
# File 'lib/hooksniff/models.rb', line 50

def response_status
  @response_status
end

#statusObject (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_hObject



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