Class: Elmas::ResultSet
- Inherits:
-
Object
- Object
- Elmas::ResultSet
- Defined in:
- lib/elmas/result_set.rb
Instance Attribute Summary collapse
-
#records ⇒ Object
readonly
Returns the value of attribute records.
Instance Method Summary collapse
- #first ⇒ Object
-
#initialize(parsed_response) ⇒ ResultSet
constructor
A new instance of ResultSet.
- #next_page ⇒ Object
Constructor Details
#initialize(parsed_response) ⇒ ResultSet
Returns a new instance of ResultSet.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/elmas/result_set.rb', line 7 def initialize(parsed_response) @parsed_response = parsed_response @records = if @parsed_response.results @parsed_response.results.map do |attributes| resource_class.send(:new, attributes) end else [resource_class.send(:new, @parsed_response.result)] end end |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
5 6 7 |
# File 'lib/elmas/result_set.rb', line 5 def records @records end |
Instance Method Details
#first ⇒ Object
28 29 30 |
# File 'lib/elmas/result_set.rb', line 28 def first records.first end |