Class: Aha::Auth::SessionsResource::SessionInfo
- Inherits:
-
Object
- Object
- Aha::Auth::SessionsResource::SessionInfo
- Defined in:
- lib/aha/auth/sessions_resource.rb
Overview
Represents a session from the auth server
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ SessionInfo
constructor
A new instance of SessionInfo.
Constructor Details
#initialize(attributes = {}) ⇒ SessionInfo
Returns a new instance of SessionInfo.
13 14 15 16 17 18 19 |
# File 'lib/aha/auth/sessions_resource.rb', line 13 def initialize(attributes = {}) @id = attributes["id"] || attributes[:id] @ip_address = attributes["ip_address"] || attributes[:ip_address] @user_agent = attributes["user_agent"] || attributes[:user_agent] @created_at = parse_time(attributes["created_at"] || attributes[:created_at]) @expires_at = parse_time(attributes["expires_at"] || attributes[:expires_at]) end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
11 12 13 |
# File 'lib/aha/auth/sessions_resource.rb', line 11 def created_at @created_at end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
11 12 13 |
# File 'lib/aha/auth/sessions_resource.rb', line 11 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/aha/auth/sessions_resource.rb', line 11 def id @id end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
11 12 13 |
# File 'lib/aha/auth/sessions_resource.rb', line 11 def ip_address @ip_address end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
11 12 13 |
# File 'lib/aha/auth/sessions_resource.rb', line 11 def user_agent @user_agent end |