Class: FacebookTestUsers::User
- Inherits:
-
Object
- Object
- FacebookTestUsers::User
- Defined in:
- lib/facebook_test_users/user.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#login_url ⇒ Object
Returns the value of attribute login_url.
-
#password ⇒ Object
Returns the value of attribute password.
Instance Method Summary collapse
-
#birthday ⇒ Object
Facebook test users all share the same birthday.
- #change(options = {}) ⇒ Object
- #destroy ⇒ Object
-
#initialize(attrs) ⇒ User
constructor
A new instance of User.
- #owner_apps(app) ⇒ Object
- #send_friend_request_to(other) ⇒ Object
Constructor Details
#initialize(attrs) ⇒ User
Returns a new instance of User.
8 9 10 11 12 |
# File 'lib/facebook_test_users/user.rb', line 8 def initialize(attrs) attrs.each do |field, value| instance_variable_set("@#{field}", value) if respond_to?(field) end end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/facebook_test_users/user.rb', line 6 def access_token @access_token end |
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/facebook_test_users/user.rb', line 6 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/facebook_test_users/user.rb', line 6 def id @id end |
#login_url ⇒ Object
Returns the value of attribute login_url.
6 7 8 |
# File 'lib/facebook_test_users/user.rb', line 6 def login_url @login_url end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/facebook_test_users/user.rb', line 6 def password @password end |
Instance Method Details
#birthday ⇒ Object
Facebook test users all share the same birthday. Perhaps it’s the developer’s!
28 29 30 |
# File 'lib/facebook_test_users/user.rb', line 28 def birthday Date.new(1980, 8, 8) end |
#change(options = {}) ⇒ Object
14 15 16 |
# File 'lib/facebook_test_users/user.rb', line 14 def change( = {}) RestClient.post(change_url, {:access_token => access_token}.merge()) end |
#destroy ⇒ Object
22 23 24 |
# File 'lib/facebook_test_users/user.rb', line 22 def destroy RestClient.delete(destroy_url) end |
#owner_apps(app) ⇒ Object
18 19 20 |
# File 'lib/facebook_test_users/user.rb', line 18 def owner_apps(app) RestClient.get(owner_apps_url(app.access_token)) end |
#send_friend_request_to(other) ⇒ Object
32 33 34 35 |
# File 'lib/facebook_test_users/user.rb', line 32 def send_friend_request_to(other) RestClient.post(friend_request_url_for(other), 'access_token' => access_token.to_s) end |