Module: Oauth::Models::Consumers::Token::InstanceMethods
- Defined in:
- lib/oauth/models/consumers/token.rb
Instance Method Summary collapse
-
#client ⇒ Object
Main client for interfacing with remote service.
- #create_user ⇒ Object
-
#params_for_user ⇒ Object
Override this to return user data from service.
- #simple_client ⇒ Object
Instance Method Details
#client ⇒ Object
Main client for interfacing with remote service. Override this to use preexisting library eg. Twitter gem.
97 98 99 |
# File 'lib/oauth/models/consumers/token.rb', line 97 def client @client||=OAuth::AccessToken.new self.class.consumer,token,secret end |
#create_user ⇒ Object
110 111 112 113 114 115 |
# File 'lib/oauth/models/consumers/token.rb', line 110 def create_user self.user ||= begin User.new params_for_user user.save(:validate=>false) end end |
#params_for_user ⇒ Object
Override this to return user data from service
106 107 108 |
# File 'lib/oauth/models/consumers/token.rb', line 106 def params_for_user {} end |
#simple_client ⇒ Object
101 102 103 |
# File 'lib/oauth/models/consumers/token.rb', line 101 def simple_client @simple_client||=SimpleClient.new client end |