Module: Oauth::Models::Consumers::Token::InstanceMethods

Defined in:
lib/oauth/models/consumers/token.rb

Instance Method Summary collapse

Instance Method Details

#clientObject

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_userObject



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_userObject

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_clientObject



101
102
103
# File 'lib/oauth/models/consumers/token.rb', line 101

def simple_client
  @simple_client||=SimpleClient.new client
end