Class: LoginRadius::LoginRadiusSession
- Inherits:
-
Object
- Object
- LoginRadius::LoginRadiusSession
- Defined in:
- lib/loginradius.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(api_key, base_url = "http://hub.loginradius.com") ⇒ LoginRadiusSession
constructor
A new instance of LoginRadiusSession.
- #is_authentic_token?(token, id) ⇒ Boolean
Constructor Details
#initialize(api_key, base_url = "http://hub.loginradius.com") ⇒ LoginRadiusSession
Returns a new instance of LoginRadiusSession.
27 28 29 30 31 |
# File 'lib/loginradius.rb', line 27 def initialize(api_key, base_url = "http://hub.loginradius.com") @api_key = api_key @base_url = base_url.sub(/\/*$/, '') @data = "" end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
25 26 27 |
# File 'lib/loginradius.rb', line 25 def api_key @api_key end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
25 26 27 |
# File 'lib/loginradius.rb', line 25 def base_url @base_url end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
25 26 27 |
# File 'lib/loginradius.rb', line 25 def data @data end |
Instance Method Details
#is_authentic_token?(token, id) ⇒ Boolean
33 34 35 36 |
# File 'lib/loginradius.rb', line 33 def is_authentic_token?(token, id) @data = api_call 'userprofile', :token => token result = (@data['ID'].to_s == id.to_s) end |