Class: RedHaze::Collection

Inherits:
Object
  • Object
show all
Includes:
Helpers::Resource
Defined in:
lib/red_haze/collection.rb

Instance Attribute Summary collapse

Attributes included from Helpers::Resource

#id

Instance Method Summary collapse

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_hrefObject (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

#itemsObject (readonly)

Returns the value of attribute items.



4
5
6
# File 'lib/red_haze/collection.rb', line 4

def items
  @items
end

#next_hrefObject (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

#nextObject



11
12
13
# File 'lib/red_haze/collection.rb', line 11

def next
  self.class.new Request.get(@next_href)
end