Class: FlexmlsApi::Authentication::Session
- Inherits:
-
Object
- Object
- FlexmlsApi::Authentication::Session
- Defined in:
- lib/flexmls_api/authentication/api_auth.rb
Overview
Session class
Handle on the api user session information as return by the api session service, including roles, tokens and expiration
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#expires ⇒ Object
Returns the value of attribute expires.
-
#roles ⇒ Object
Returns the value of attribute roles.
Instance Method Summary collapse
-
#expired? ⇒ Boolean
Is the user session token expired?.
-
#initialize(options = {}) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(options = {}) ⇒ Session
Returns a new instance of Session.
92 93 94 95 96 |
# File 'lib/flexmls_api/authentication/api_auth.rb', line 92 def initialize(={}) @auth_token = ["AuthToken"] @expires = DateTime.parse ["Expires"] @roles = ["Roles"] end |
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
91 92 93 |
# File 'lib/flexmls_api/authentication/api_auth.rb', line 91 def auth_token @auth_token end |
#expires ⇒ Object
Returns the value of attribute expires.
91 92 93 |
# File 'lib/flexmls_api/authentication/api_auth.rb', line 91 def expires @expires end |
#roles ⇒ Object
Returns the value of attribute roles.
91 92 93 |
# File 'lib/flexmls_api/authentication/api_auth.rb', line 91 def roles @roles end |
Instance Method Details
#expired? ⇒ Boolean
Is the user session token expired?
98 99 100 |
# File 'lib/flexmls_api/authentication/api_auth.rb', line 98 def expired? DateTime.now > @expires end |