Class: SML::GetProcParameter::Response

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, parameter_treepath, parameter_tree) ⇒ Response

Returns a new instance of Response.



39
40
41
42
43
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 39

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

Instance Attribute Details

#parameter_treeObject

Returns the value of attribute parameter_tree.



37
38
39
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 37

def parameter_tree
  @parameter_tree
end

#parameter_treepathObject

Returns the value of attribute parameter_treepath.



37
38
39
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 37

def parameter_treepath
  @parameter_treepath
end

#server_idObject

Returns the value of attribute server_id.



37
38
39
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 37

def server_id
  @server_id
end

Class Method Details

.construct(array_rep) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 45

def self.construct(array_rep)
  return nil if array_rep.nil?
  server_id = array_rep.shift
  parameter_treepath = SML::Treepath.construct(array_rep.shift)
  parameter_tree = SML::Tree.construct(array_rep.shift)

  return nil if (server_id.nil? or parameter_treepath.nil? or parameter_tree.nil?)
  return SML::GetProcParameter::Response.new(server_id, parameter_treepath, parameter_tree)
end

Instance Method Details

#to_aObject



54
55
56
# File 'lib/ruby-sml/sml-getprocparameter.rb', line 54

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