Class: Paymos::Page
Instance Attribute Summary collapse
-
#items ⇒ Array[Item]
readonly
Returns the value of attribute items.
-
#next_cursor ⇒ String?
readonly
Returns the value of attribute next_cursor.
Class Method Summary collapse
Methods inherited from Model
#[], deep_freeze, fields, #initialize, #to_h
Constructor Details
This class inherits a constructor from Paymos::Model
Instance Attribute Details
#items ⇒ Array[Item] (readonly)
Returns the value of attribute items.
146 147 148 |
# File 'sig/paymos.rbs', line 146 def items @items end |
#next_cursor ⇒ String? (readonly)
Returns the value of attribute next_cursor.
147 148 149 |
# File 'sig/paymos.rbs', line 147 def next_cursor @next_cursor end |
Class Method Details
.from(value, item_type:) ⇒ Object
137 138 139 140 141 142 |
# File 'lib/paymos/models.rb', line 137 def self.from(value, item_type:) model = super(value) raise Error, 'Paymos API page items must be an array' unless model.items.is_a?(Array) new(items: model.items.map { |item| item_type.from(item) }, next_cursor: model.next_cursor) end |