Class: HookSniff::Models::DeliveryList

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ DeliveryList

Returns a new instance of DeliveryList.



106
107
108
109
110
111
# File 'lib/hooksniff/models.rb', line 106

def initialize(data)
  @deliveries = (data["deliveries"] || []).map { |d| Delivery.new(d) }
  @total = data["total"]
  @page = data["page"]
  @per_page = data["per_page"]
end

Instance Attribute Details

#deliveriesObject (readonly)

Returns the value of attribute deliveries.



104
105
106
# File 'lib/hooksniff/models.rb', line 104

def deliveries
  @deliveries
end

#pageObject (readonly)

Returns the value of attribute page.



104
105
106
# File 'lib/hooksniff/models.rb', line 104

def page
  @page
end

#per_pageObject (readonly)

Returns the value of attribute per_page.



104
105
106
# File 'lib/hooksniff/models.rb', line 104

def per_page
  @per_page
end

#totalObject (readonly)

Returns the value of attribute total.



104
105
106
# File 'lib/hooksniff/models.rb', line 104

def total
  @total
end