Class: SML::GetProcParameter::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-sml/sml-getprocparameter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_id, username, password, parameter_treepath, attribute) ⇒ Request

Returns a new instance of Request.



11
12
13
14
15
16
17
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 11

def initialize(server_id, username, password, parameter_treepath, attribute)
  @server_id = server_id
  @username = username
  @password = password
  @parameter_treepath = parameter_treepath
  @attribute = attribute
end

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



9
10
11
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 9

def attribute
  @attribute
end

#parameter_treepathObject

Returns the value of attribute parameter_treepath.



9
10
11
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 9

def parameter_treepath
  @parameter_treepath
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 9

def password
  @password
end

#server_idObject

Returns the value of attribute server_id.



9
10
11
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 9

def server_id
  @server_id
end

#usernameObject

Returns the value of attribute username.



9
10
11
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 9

def username
  @username
end

Class Method Details

.construct(array_rep) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 19

def self.construct(array_rep)
  return nil if array_rep.nil?
  server_id = array_rep.shift
  username = array_rep.shift
  password = array_rep.shift
  parameter_treepath = SML::Treepath.construct(array_rep.shift)
  attribute = array_rep.shift

  return nil if parameter_treepath.nil?
  return SML::GetProcParameter::Request.new(server_id, username, password, parameter_treepath, attribute)
end

Instance Method Details

#to_aObject



30
31
32
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 30

def to_a
  return [] << server_id << username << password << parameter_treepath.to_a << attribute
end