Class: Ixtlan::Guard::AbstractSession

Inherits:
Object
  • Object
show all
Defined in:
lib/ixtlan/guard/abstract_session.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idle_session_timeoutObject

Returns the value of attribute idle_session_timeout.



5
6
7
# File 'lib/ixtlan/guard/abstract_session.rb', line 5

def idle_session_timeout
  @idle_session_timeout
end

#permissionsObject

Returns the value of attribute permissions.



5
6
7
# File 'lib/ixtlan/guard/abstract_session.rb', line 5

def permissions
  @permissions
end

#userObject

Returns the value of attribute user.



5
6
7
# File 'lib/ixtlan/guard/abstract_session.rb', line 5

def user
  @user
end

Class Method Details

.create(login, password) ⇒ Object



7
8
9
# File 'lib/ixtlan/guard/abstract_session.rb', line 7

def self.create(, password)
  self.do_create(authenticate(, password))
end

.create_remote(login, password) ⇒ Object



11
12
13
# File 'lib/ixtlan/guard/abstract_session.rb', line 11

def self.create_remote(, password)
  self.do_create(authenticate_remote(, password))
end

Instance Method Details

#attributesObject



46
47
48
# File 'lib/ixtlan/guard/abstract_session.rb', line 46

def attributes
  {'idle_session_timeout' => idle_session_timeout, 'permissions' => permissions, 'user' => user}
end

#log=(msg) ⇒ Object



30
31
32
# File 'lib/ixtlan/guard/abstract_session.rb', line 30

def log=(msg)
  @log = msg
end

#to_logObject



34
35
36
37
38
39
40
# File 'lib/ixtlan/guard/abstract_session.rb', line 34

def to_log
  if @log
    @log
  else
    "Session(user-id: #{user.id}, idle-session-timeout: #{idle_session_timeout})"
  end
end

#valid?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/ixtlan/guard/abstract_session.rb', line 42

def valid?
  @log.nil?
end