Class: MetaGraph::Collection
- Inherits:
-
Array
- Object
- Array
- MetaGraph::Collection
- Includes:
- GraphAccessor
- Defined in:
- lib/meta_graph/collection.rb
Overview
Collection class presents an array data in Facebook Graph API.
Instance Method Summary collapse
- #[](index) ⇒ Object
-
#initialize(access_token, collection) ⇒ Collection
constructor
Create Collection instance from an array.
Methods included from GraphAccessor
Constructor Details
#initialize(access_token, collection) ⇒ Collection
Create Collection instance from an array.
Arguments
- access_token
-
access token to read a data from Graph API. Please set to oauth’s access_token.
- collection
-
An array of collection data.
16 17 18 19 20 21 |
# File 'lib/meta_graph/collection.rb', line 16 def initialize(access_token, collection) @access_token = access_token @collection = collection replace @collection end |
Instance Method Details
#[](index) ⇒ Object
23 24 25 |
# File 'lib/meta_graph/collection.rb', line 23 def [](index) read_graph(@access_token, @collection[index]) end |