Class: Remitmd::TransactionList
Instance Attribute Summary collapse
-
#has_more ⇒ Object
readonly
Returns the value of attribute has_more.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#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(attrs) ⇒ TransactionList
constructor
A new instance of TransactionList.
Methods inherited from Model
Constructor Details
#initialize(attrs) ⇒ TransactionList
Returns a new instance of TransactionList.
429 430 431 432 433 434 435 436 437 |
# File 'lib/remitmd/models.rb', line 429 def initialize(attrs) h = attrs.transform_keys(&:to_s) items_raw = h["items"] || [] @items = items_raw.map { |tx| Transaction.new(tx) } @total = h["total"].to_i @page = (h["page"] || 1).to_i @per_page = (h["per_page"] || 50).to_i @has_more = h["has_more"] == true end |
Instance Attribute Details
#has_more ⇒ Object (readonly)
Returns the value of attribute has_more.
439 440 441 |
# File 'lib/remitmd/models.rb', line 439 def has_more @has_more end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
439 440 441 |
# File 'lib/remitmd/models.rb', line 439 def items @items end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
439 440 441 |
# File 'lib/remitmd/models.rb', line 439 def page @page end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
439 440 441 |
# File 'lib/remitmd/models.rb', line 439 def per_page @per_page end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
439 440 441 |
# File 'lib/remitmd/models.rb', line 439 def total @total end |