Class: SML::SetProcParameter::Request

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Request.


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

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

Instance Attribute Details

#parameter_treeObject

Returns the value of attribute parameter_tree.


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

def parameter_tree
  @parameter_tree
end

#parameter_treepathObject

Returns the value of attribute parameter_treepath.


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

def parameter_treepath
  @parameter_treepath
end

#passwordObject

Returns the value of attribute password.


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

def password
  @password
end

#server_idObject

Returns the value of attribute server_id.


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

def server_id
  @server_id
end

#usernameObject

Returns the value of attribute username.


9
10
11
# File 'lib/ruby-sml/sml-setprocparameter.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-setprocparameter.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)
  parameter_tree = SML::Tree.construct(array_rep.shift)

  return nil if (parameter_treepath.nil? or parameter_tree.nil?)
  return SML::SetProcParameter::Request.new(server_id, username, password, parameter_treepath, parameter_tree)
end

Instance Method Details

#to_aObject


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

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