Class: RedHaze::Collection
- Inherits:
-
Object
- Object
- RedHaze::Collection
- Includes:
- Helpers::Resource
- Defined in:
- lib/red_haze/collection.rb
Instance Attribute Summary collapse
-
#future_href ⇒ Object
readonly
Returns the value of attribute future_href.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#next_href ⇒ Object
readonly
Returns the value of attribute next_href.
Attributes included from Helpers::Resource
Instance Method Summary collapse
-
#initialize(arg) ⇒ Collection
constructor
A new instance of Collection.
- #next ⇒ Object
Methods included from Helpers::Resource
#delete_endpoint, #get_endpoint, included, #put_endpoint, #sync, #url
Constructor Details
#initialize(arg) ⇒ Collection
Returns a new instance of Collection.
5 6 7 8 9 |
# File 'lib/red_haze/collection.rb', line 5 def initialize(arg) @items = arg['collection'].collect { |r| Activity.new(r) } @next_href = arg['next_href'] @future_href = arg['future_href'] end |
Instance Attribute Details
#future_href ⇒ Object (readonly)
Returns the value of attribute future_href.
4 5 6 |
# File 'lib/red_haze/collection.rb', line 4 def future_href @future_href end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
4 5 6 |
# File 'lib/red_haze/collection.rb', line 4 def items @items end |
#next_href ⇒ Object (readonly)
Returns the value of attribute next_href.
4 5 6 |
# File 'lib/red_haze/collection.rb', line 4 def next_href @next_href end |
Instance Method Details
#next ⇒ Object
11 12 13 |
# File 'lib/red_haze/collection.rb', line 11 def next self.class.new Request.get(@next_href) end |