Class: HookSniff::Models::DeliveryList
- Inherits:
-
Object
- Object
- HookSniff::Models::DeliveryList
- Defined in:
- lib/hooksniff/models.rb
Instance Attribute Summary collapse
-
#deliveries ⇒ Object
readonly
Returns the value of attribute deliveries.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(data) ⇒ DeliveryList
constructor
A new instance of DeliveryList.
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
#deliveries ⇒ Object (readonly)
Returns the value of attribute deliveries.
104 105 106 |
# File 'lib/hooksniff/models.rb', line 104 def deliveries @deliveries end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
104 105 106 |
# File 'lib/hooksniff/models.rb', line 104 def page @page end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
104 105 106 |
# File 'lib/hooksniff/models.rb', line 104 def per_page @per_page end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
104 105 106 |
# File 'lib/hooksniff/models.rb', line 104 def total @total end |