Class: FbGraph2::Collection
- Inherits:
-
Array
- Object
- Array
- FbGraph2::Collection
- Defined in:
- lib/fb_graph2/collection.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cursors ⇒ Object
readonly
Returns the value of attribute cursors.
-
#next ⇒ Object
readonly
Returns the value of attribute next.
-
#previous ⇒ Object
readonly
Returns the value of attribute previous.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
-
#unread_count ⇒ Object
readonly
Returns the value of attribute unread_count.
-
#updated_time ⇒ Object
readonly
Returns the value of attribute updated_time.
Instance Method Summary collapse
-
#initialize(collection = nil) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(collection = nil) ⇒ Collection
Returns a new instance of Collection.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/fb_graph2/collection.rb', line 5 def initialize(collection = nil) collection = case collection when Hash collection when Array { data: collection, count: collection.size } else raise ArgumentError.new("Invalid collection") end replace Array(collection[:data]) end |
Instance Attribute Details
#cursors ⇒ Object (readonly)
Returns the value of attribute cursors.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def cursors @cursors end |
#next ⇒ Object (readonly)
Returns the value of attribute next.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def next @next end |
#previous ⇒ Object (readonly)
Returns the value of attribute previous.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def previous @previous end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def total_count @total_count end |
#unread_count ⇒ Object (readonly)
Returns the value of attribute unread_count.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def unread_count @unread_count end |
#updated_time ⇒ Object (readonly)
Returns the value of attribute updated_time.
3 4 5 |
# File 'lib/fb_graph2/collection.rb', line 3 def updated_time @updated_time end |