Class: FbGraph2::Collection
- Inherits:
-
Array
- Object
- Array
- FbGraph2::Collection
- Defined in:
- lib/fb_graph2/collection.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#after ⇒ Object
Returns the value of attribute after.
-
#before ⇒ Object
Returns the value of attribute before.
-
#next ⇒ Object
Returns the value of attribute next.
-
#previous ⇒ Object
Returns the value of attribute previous.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#total_count ⇒ Object
Returns the value of attribute total_count.
Instance Method Summary collapse
-
#initialize(collection = []) ⇒ Collection
constructor
A new instance of Collection.
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
#after ⇒ Object
Returns the value of attribute after.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def after @after end |
#before ⇒ Object
Returns the value of attribute before.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def before @before end |
#next ⇒ Object
Returns the value of attribute next.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def next @next end |
#previous ⇒ Object
Returns the value of attribute previous.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def previous @previous end |
#summary ⇒ Object
Returns the value of attribute summary.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def summary @summary end |
#total_count ⇒ Object
Returns the value of attribute total_count.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def total_count @total_count end |