Class: Aha::Auth::SessionsResource::SessionInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/aha/auth/sessions_resource.rb

Overview

Represents a session from the auth server

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject (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_atObject (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

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/aha/auth/sessions_resource.rb', line 11

def id
  @id
end

#ip_addressObject (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_agentObject (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