Class: FluvPay::Resources::OffsetList
- Inherits:
-
Object
- Object
- FluvPay::Resources::OffsetList
- Includes:
- Enumerable
- Defined in:
- lib/fluvpay/resources/list_objects.rb
Overview
Página baseada em limit/offset (usada por withdrawals.list e internal_transfers.list). Expõe #data e os metadados limit, offset e total, exatamente como o backend retorna. Também é iterável.
Instance Attribute Summary collapse
-
#data ⇒ Array<Hash>
readonly
Itens da página.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(payload) ⇒ OffsetList
constructor
A new instance of OffsetList.
Constructor Details
#initialize(payload) ⇒ OffsetList
Returns a new instance of OffsetList.
52 53 54 55 56 57 58 |
# File 'lib/fluvpay/resources/list_objects.rb', line 52 def initialize(payload) payload ||= {} @data = payload["data"] || [] @limit = payload["limit"] @offset = payload["offset"] @total = payload["total"] end |
Instance Attribute Details
#data ⇒ Array<Hash> (readonly)
Returns itens da página.
49 50 51 |
# File 'lib/fluvpay/resources/list_objects.rb', line 49 def data @data end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
50 51 52 |
# File 'lib/fluvpay/resources/list_objects.rb', line 50 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
50 51 52 |
# File 'lib/fluvpay/resources/list_objects.rb', line 50 def offset @offset end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
50 51 52 |
# File 'lib/fluvpay/resources/list_objects.rb', line 50 def total @total end |
Instance Method Details
#each(&block) ⇒ Object
60 61 62 |
# File 'lib/fluvpay/resources/list_objects.rb', line 60 def each(&block) @data.each(&block) end |