Class: Avmtrf1::ActiveDirectory::User

Inherits:
Object
  • Object
show all
Defined in:
lib/avmtrf1/active_directory/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain, username, password) ⇒ User

Returns a new instance of User.


17
18
19
20
21
# File 'lib/avmtrf1/active_directory/user.rb', line 17

def initialize(domain, username, password)
  @domain = domain
  @username = username
  @password = password
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.


15
16
17
# File 'lib/avmtrf1/active_directory/user.rb', line 15

def domain
  @domain
end

#passwordObject (readonly)

Returns the value of attribute password.


15
16
17
# File 'lib/avmtrf1/active_directory/user.rb', line 15

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.


15
16
17
# File 'lib/avmtrf1/active_directory/user.rb', line 15

def username
  @username
end

Class Method Details

.by_configs(path_prefix) ⇒ Object


7
8
9
10
11
12
13
# File 'lib/avmtrf1/active_directory/user.rb', line 7

def by_configs(path_prefix)
  new(
    ::EacConfig::Node.context.current.entry("#{path_prefix}.domain").value,
    ::EacConfig::Node.context.current.entry("#{path_prefix}.username").value,
    ::EacConfig::Node.context.current.entry("#{path_prefix}.password", noecho: true).value
  )
end

Instance Method Details

#username_with_domainObject


23
24
25
# File 'lib/avmtrf1/active_directory/user.rb', line 23

def username_with_domain
  "#{domain}\\#{username}"
end