Class: FbGraph2::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/fb_graph2/collection.rb

Direct Known Subclasses

Edge, Searchable::Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection = []) ⇒ Collection

Returns a new instance of Collection.



5
6
7
8
9
10
# File 'lib/fb_graph2/collection.rb', line 5

def initialize(collection = [])
  collection = normalize collection
  paginate collection[:paging]
  summarize collection[:summary]
  replace Array(collection[:data])
end

Instance Attribute Details

#afterObject

Returns the value of attribute after.



3
4
5
# File 'lib/fb_graph2/collection.rb', line 3

def after
  @after
end

#beforeObject

Returns the value of attribute before.



3
4
5
# File 'lib/fb_graph2/collection.rb', line 3

def before
  @before
end

#nextObject

Returns the value of attribute next.



3
4
5
# File 'lib/fb_graph2/collection.rb', line 3

def next
  @next
end

#previousObject

Returns the value of attribute previous.



3
4
5
# File 'lib/fb_graph2/collection.rb', line 3

def previous
  @previous
end

#summaryObject

Returns the value of attribute summary.



3
4
5
# File 'lib/fb_graph2/collection.rb', line 3

def summary
  @summary
end

#total_countObject

Returns the value of attribute total_count.



3
4
5
# File 'lib/fb_graph2/collection.rb', line 3

def total_count
  @total_count
end