Class: Restforce::Collection
- Inherits:
-
Array
- Object
- Array
- Restforce::Collection
- Defined in:
- lib/restforce/collection.rb
Instance Attribute Summary collapse
-
#next_page_url ⇒ Object
readonly
Returns the value of attribute next_page_url.
-
#total_size ⇒ Object
readonly
Returns the value of attribute total_size.
Instance Method Summary collapse
-
#initialize(hash, client) ⇒ Collection
constructor
A new instance of Collection.
- #next_page ⇒ Object
Constructor Details
#initialize(hash, client) ⇒ Collection
Returns a new instance of Collection.
5 6 7 8 9 10 |
# File 'lib/restforce/collection.rb', line 5 def initialize(hash, client) @client = client @total_size = hash['totalSize'] @next_page_url = hash['nextRecordsUrl'] super(Restforce::Mash.build(hash['records'], @client)) end |
Instance Attribute Details
#next_page_url ⇒ Object (readonly)
Returns the value of attribute next_page_url.
3 4 5 |
# File 'lib/restforce/collection.rb', line 3 def next_page_url @next_page_url end |
#total_size ⇒ Object (readonly)
Returns the value of attribute total_size.
3 4 5 |
# File 'lib/restforce/collection.rb', line 3 def total_size @total_size end |
Instance Method Details
#next_page ⇒ Object
12 13 14 15 |
# File 'lib/restforce/collection.rb', line 12 def next_page response = @client.get next_page_url response.body end |