Class: KapsoClientRuby::Types::PagedResponse
- Inherits:
-
Object
- Object
- KapsoClientRuby::Types::PagedResponse
- Defined in:
- lib/kapso_client_ruby/types.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#paging ⇒ Object
readonly
Returns the value of attribute paging.
Instance Method Summary collapse
-
#initialize(data, item_class = nil) ⇒ PagedResponse
constructor
A new instance of PagedResponse.
Constructor Details
#initialize(data, item_class = nil) ⇒ PagedResponse
Returns a new instance of PagedResponse.
124 125 126 127 128 129 130 131 |
# File 'lib/kapso_client_ruby/types.rb', line 124 def initialize(data, item_class = nil) @data = if item_class && data['data'].is_a?(Array) data['data'].map { |item| item_class.new(item) } else data['data'] || [] end @paging = GraphPaging.new(data['paging'] || {}) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
122 123 124 |
# File 'lib/kapso_client_ruby/types.rb', line 122 def data @data end |
#paging ⇒ Object (readonly)
Returns the value of attribute paging.
122 123 124 |
# File 'lib/kapso_client_ruby/types.rb', line 122 def paging @paging end |