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.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/elmas/result_set.rb', line 5 def initialize(parsed_response) @parsed_response = parsed_response if @parsed_response.results @records = @parsed_response.results.map do |attributes| resource_class.send(:new, attributes) end else @records = [resource_class.send(:new, @parsed_response.result)] end end |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
3 4 5 |
# File 'lib/elmas/result_set.rb', line 3 def records @records end |
Instance Method Details
#first ⇒ Object
26 27 28 |
# File 'lib/elmas/result_set.rb', line 26 def first records.first end |