Class: Identikey::Administration::SessionQuery
- Inherits:
-
Object
- Object
- Identikey::Administration::SessionQuery
- Defined in:
- lib/identikey/administration/session_query.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#idx ⇒ Object
readonly
Returns the value of attribute idx.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(idx:, username:, domain:, location:, start_time:) ⇒ SessionQuery
constructor
A new instance of SessionQuery.
Constructor Details
#initialize(idx:, username:, domain:, location:, start_time:) ⇒ SessionQuery
Returns a new instance of SessionQuery.
25 26 27 28 29 30 31 |
# File 'lib/identikey/administration/session_query.rb', line 25 def initialize(idx:, username:, domain:, location:, start_time:) @idx = idx @username = username @domain = domain @location = location @start_time = start_time end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
23 24 25 |
# File 'lib/identikey/administration/session_query.rb', line 23 def domain @domain end |
#idx ⇒ Object (readonly)
Returns the value of attribute idx.
23 24 25 |
# File 'lib/identikey/administration/session_query.rb', line 23 def idx @idx end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
23 24 25 |
# File 'lib/identikey/administration/session_query.rb', line 23 def location @location end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
23 24 25 |
# File 'lib/identikey/administration/session_query.rb', line 23 def start_time @start_time end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
23 24 25 |
# File 'lib/identikey/administration/session_query.rb', line 23 def username @username end |
Class Method Details
.all(session:) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/identikey/administration/session_query.rb', line 5 def self.all(session:) stat, sessions, error = session.execute(:admin_session_query) if stat != 'STAT_SUCCESS' raise Identikey::OperationFailed, "query failed: #{stat} - #{error}" end sessions.map do |sess| new( idx: sess['ADMINSESSIONFLD_SESSION_IDX'], username: sess['ADMINSESSIONFLD_LOGIN_NAME'], domain: sess['ADMINSESSIONFLD_DOMAIN'], location: sess['ADMINSESSIONFLD_LOCATION'], start_time: sess['ADMINSESSIONFLD_START_TIME'] ) end end |