Class: Facebook::GraphApi
- Inherits:
-
Object
- Object
- Facebook::GraphApi
- Defined in:
- lib/facebook/graph_api.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#fb_api ⇒ Object
readonly
Returns the value of attribute fb_api.
Class Method Summary collapse
Instance Method Summary collapse
- #api ⇒ Object
-
#initialize(session) ⇒ GraphApi
constructor
A new instance of GraphApi.
-
#me ⇒ Object
also see developers.facebook.com/docs/reference/fql/ The Facebook Query Language for more efficient complex queries Also enables Multi-query.
- #my_friends ⇒ Object
- #my_messages ⇒ Object
- #my_picture ⇒ Object
-
#post_on_wall(message) ⇒ Object
Post.
Constructor Details
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
11 12 13 |
# File 'lib/facebook/graph_api.rb', line 11 def access_token @access_token end |
#fb_api ⇒ Object (readonly)
Returns the value of attribute fb_api.
11 12 13 |
# File 'lib/facebook/graph_api.rb', line 11 def fb_api @fb_api end |
Class Method Details
Instance Method Details
#api ⇒ Object
19 20 21 |
# File 'lib/facebook/graph_api.rb', line 19 def api @api ||= fb_api end |
#me ⇒ Object
also see developers.facebook.com/docs/reference/fql/ The Facebook Query Language for more efficient complex queries Also enables Multi-query
31 32 33 |
# File 'lib/facebook/graph_api.rb', line 31 def me @me ||= ::Hashie::Mash.new api.get_object('me') end |
#my_friends ⇒ Object
42 43 44 45 |
# File 'lib/facebook/graph_api.rb', line 42 def my_friends # or fb.me.friends me.friends end |
#my_messages ⇒ Object
51 52 53 |
# File 'lib/facebook/graph_api.rb', line 51 def api.get_object "/me/statuses", "fields"=>"message" end |
#my_picture ⇒ Object
47 48 49 |
# File 'lib/facebook/graph_api.rb', line 47 def my_picture api.get_picture my_id end |
#post_on_wall(message) ⇒ Object
Post
57 58 59 |
# File 'lib/facebook/graph_api.rb', line 57 def post_on_wall api.put_wall_post end |