Module: PpLogin

Defined in:
lib/pp_login.rb,
lib/pp_login/engine.rb,
lib/pp_login/version.rb,
lib/pp_login/main/modules/setup.rb,
lib/pp_login/main/modules/helpers.rb,
app/helpers/pp_login/application_helper.rb,
lib/pp_login/main/modules/account_actions.rb,
app/controllers/pp_login/pp_account_controller.rb,
app/controllers/pp_login/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, Helpers Classes: ApplicationController, Engine, PpAccountController

Constant Summary collapse

VERSION =
"0.0.3"
Desc =
"This gem will Add an engine to handle loging in with paypal,
 getting user info and logging out again.
"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.idObject

Returns the value of attribute id.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def id
  @id
end

.loginURLObject

Returns the value of attribute loginURL.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def loginURL
  @loginURL
end

.modeObject

Returns the value of attribute mode.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def mode
  @mode
end

.redirect_urlObject

Returns the value of attribute redirect_url.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def redirect_url
  @redirect_url
end

.scopeObject

Returns the value of attribute scope.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def scope
  @scope
end

.secretObject

Returns the value of attribute secret.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def secret
  @secret
end

.token_modelObject

Returns the value of attribute token_model.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def token_model
  @token_model
end

.token_storeObject

Returns the value of attribute token_store.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def token_store
  @token_store
end

.user_modelObject

Returns the value of attribute user_model.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def user_model
  @user_model
end

.user_storeObject

Returns the value of attribute user_store.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def user_store
  @user_store
end

.website_urlObject

Returns the value of attribute website_url.



3
4
5
# File 'lib/pp_login/main/modules/setup.rb', line 3

def website_url
  @website_url
end

Class Method Details

.get_access_token(code) ⇒ Object



3
4
5
# File 'lib/pp_login/main/modules/account_actions.rb', line 3

def self.get_access_token(code)
	return Engine.instance_exec(code){|c| return self::Tokeninfo.create(c) }
end

.get_user_info(access_token) ⇒ Object



11
12
13
# File 'lib/pp_login/main/modules/account_actions.rb', line 11

def self.(access_token)
	return Engine.instance_exec(get_access_token){|at| self::Userinfo.get(at) }
end

.refresh_token(refresh_token) ⇒ Object



7
8
9
# File 'lib/pp_login/main/modules/account_actions.rb', line 7

def self.refresh_token(refresh_token)
	return Engine.instance_exec(refresh_token){|rt| self::Tokeninfo.refresh(rt) }
end

.setup {|_self| ... } ⇒ Object

setup function for initializer file

Yields:

  • (_self)

Yield Parameters:

  • _self (PpLogin)

    the object that the method was called on



6
7
8
9
10
# File 'lib/pp_login/main/modules/setup.rb', line 6

def self.setup(&block) #setup function for initializer file
	yield self
	self.redirect_url = self.website_url if !self.redirect_url
	self.token_store = :session if !self.token_store
end