Class: FbGraph::Query

Inherits:
Node
  • Object
show all
Defined in:
lib/fb_graph/query.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#endpoint, #identifier

Instance Method Summary collapse

Methods inherited from Node

#connection, #destroy, fetch

Methods included from Comparison

#==

Constructor Details

#initialize(query, access_token = nil) ⇒ Query

Returns a new instance of Query.



5
6
7
8
# File 'lib/fb_graph/query.rb', line 5

def initialize(query, access_token = nil)
  @query = query
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



3
4
5
# File 'lib/fb_graph/query.rb', line 3

def access_token
  @access_token
end

#queryObject

Returns the value of attribute query.



3
4
5
# File 'lib/fb_graph/query.rb', line 3

def query
  @query
end

Instance Method Details

#fetch(access_token = nil) ⇒ Object



10
11
12
13
14
15
# File 'lib/fb_graph/query.rb', line 10

def fetch(access_token = nil)
  self.access_token ||= access_token
  handle_response do
    RestClient.get build_endpoint
  end
end