Class: Reactor::Session::User

Inherits:
Object
  • Object
show all
Defined in:
lib/reactor/session/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_name) ⇒ User

Returns a new instance of User.



7
8
9
10
11
12
13
14
15
# File 'lib/reactor/session/user.rb', line 7

def initialize(user_name)
  # Rails.logger.debug "Reading user #{user_name} from CM"
  user      = Reactor::Cm::User.new(user_name)
  @user_name= user_name
  @groups   = user.groups
  @language = user.language
  @superuser= user.is_root?
  @email    = user.email
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



21
22
23
# File 'lib/reactor/session/user.rb', line 21

def email
  @email
end

#groupsObject (readonly)

Returns the value of attribute groups.



21
22
23
# File 'lib/reactor/session/user.rb', line 21

def groups
  @groups
end

#languageObject (readonly)

Returns the value of attribute language.



21
22
23
# File 'lib/reactor/session/user.rb', line 21

def language
  @language
end

#user_nameObject (readonly)

Returns the value of attribute user_name.



21
22
23
# File 'lib/reactor/session/user.rb', line 21

def user_name
  @user_name
end

Instance Method Details

#superuser?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/reactor/session/user.rb', line 23

def superuser?
  @superuser == true
end

#to_sObject



17
18
19
# File 'lib/reactor/session/user.rb', line 17

def to_s
  @user_name
end