Class: Lshmcusr

Inherits:
Object
  • Object
show all
Defined in:
lib/HMC/lshmcusr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Lshmcusr

Returns a new instance of Lshmcusr.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/HMC/lshmcusr.rb', line 31

def initialize(string)

  @data = Hash.new
  @data_string_raw=''

  @_variables = Hash.new

  @_variables['variables_int']    = [ 'disabled', 'pwage', 'remote_webui_access', 'remote_ssh_access', 'min_pwage', 'session_timeout', 'verify_timeout', 'idle_timeout', 'inactivity_expiration' ]
  @_variables['variables_string'] = [ 'name', 'taskrole', 'description', 'resourcerole', 'authentication_type', 'resources', 'password_encryption' ]

  @name = nil
  @taskrole = nil
  @description = nil
  @pwage = nil
  @resourcerole = nil
  @authentication_type = nil
  @remote_webui_access = nil
  @remote_ssh_access = nil
  @min_pwage = nil
  @session_timeout = nil
  @verify_timeout = nil
  @idle_timeout = nil
  @inactivity_expiration = nil
  @resources = nil
  @password = nil
  @password_encryption = nil
  @disabled = nil


  if string.length > 0
    @data_string_raw = string
    self.parse(string)
  end
end

Instance Attribute Details

#authentication_typeObject (readonly)

Returns the value of attribute authentication_type.



17
18
19
# File 'lib/HMC/lshmcusr.rb', line 17

def authentication_type
  @authentication_type
end

#dataObject (readonly)

Returns the value of attribute data.



8
9
10
# File 'lib/HMC/lshmcusr.rb', line 8

def data
  @data
end

#data_string_rawObject (readonly)

Returns the value of attribute data_string_raw.



9
10
11
# File 'lib/HMC/lshmcusr.rb', line 9

def data_string_raw
  @data_string_raw
end

#descriptionObject (readonly)

Returns the value of attribute description.



14
15
16
# File 'lib/HMC/lshmcusr.rb', line 14

def description
  @description
end

#disabledObject (readonly)

Returns the value of attribute disabled.



28
29
30
# File 'lib/HMC/lshmcusr.rb', line 28

def disabled
  @disabled
end

#idle_timeoutObject (readonly)

Returns the value of attribute idle_timeout.



23
24
25
# File 'lib/HMC/lshmcusr.rb', line 23

def idle_timeout
  @idle_timeout
end

#inactivity_expirationObject (readonly)

Returns the value of attribute inactivity_expiration.



24
25
26
# File 'lib/HMC/lshmcusr.rb', line 24

def inactivity_expiration
  @inactivity_expiration
end

#min_pwageObject (readonly)

Returns the value of attribute min_pwage.



20
21
22
# File 'lib/HMC/lshmcusr.rb', line 20

def min_pwage
  @min_pwage
end

#nameObject (readonly)



12
13
14
# File 'lib/HMC/lshmcusr.rb', line 12

def name
  @name
end

#passwordObject (readonly)

Returns the value of attribute password.



26
27
28
# File 'lib/HMC/lshmcusr.rb', line 26

def password
  @password
end

#password_encryptionObject (readonly)

Returns the value of attribute password_encryption.



27
28
29
# File 'lib/HMC/lshmcusr.rb', line 27

def password_encryption
  @password_encryption
end

#pwageObject (readonly)

Returns the value of attribute pwage.



15
16
17
# File 'lib/HMC/lshmcusr.rb', line 15

def pwage
  @pwage
end

#remote_ssh_accessObject (readonly)

Returns the value of attribute remote_ssh_access.



19
20
21
# File 'lib/HMC/lshmcusr.rb', line 19

def remote_ssh_access
  @remote_ssh_access
end

#remote_webui_accessObject (readonly)

Returns the value of attribute remote_webui_access.



18
19
20
# File 'lib/HMC/lshmcusr.rb', line 18

def remote_webui_access
  @remote_webui_access
end

#resourceroleObject (readonly)

Returns the value of attribute resourcerole.



16
17
18
# File 'lib/HMC/lshmcusr.rb', line 16

def resourcerole
  @resourcerole
end

#resourcesObject (readonly)

Returns the value of attribute resources.



25
26
27
# File 'lib/HMC/lshmcusr.rb', line 25

def resources
  @resources
end

#session_timeoutObject (readonly)

Returns the value of attribute session_timeout.



21
22
23
# File 'lib/HMC/lshmcusr.rb', line 21

def session_timeout
  @session_timeout
end

#taskroleObject (readonly)

Returns the value of attribute taskrole.



13
14
15
# File 'lib/HMC/lshmcusr.rb', line 13

def taskrole
  @taskrole
end

#verify_timeoutObject (readonly)

Returns the value of attribute verify_timeout.



22
23
24
# File 'lib/HMC/lshmcusr.rb', line 22

def verify_timeout
  @verify_timeout
end

Instance Method Details

#parse(string) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/HMC/lshmcusr.rb', line 66

def parse(string)

  array = HmcString.parse(string)

  array.each_pair { | key, value|
    if @_variables['variables_int'].include?(key)
      instance_variable_set("@#{key}", value.to_i)
    elsif @_variables['variables_string'].include?(key)
      instance_variable_set("@#{key}", value)
    else
      raise Exception "Unknown variable #{key}, #{value}"
    end
  }


end