Class: SML::GetProfileList::Response

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_id, act_time, registration_period, parameter_treepath, val_time, status, period_list, raw_data, period_signature) ⇒ Response

Returns a new instance of Response.



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 52

def initialize(server_id, act_time, registration_period, parameter_treepath, val_time, status, period_list, raw_data, period_signature)
  @server_id = server_id
  @act_time = act_time
  @registration_period = registration_period
  @parameter_treepath = parameter_treepath
  @val_time = val_time
  @status = status
  @period_list = period_list
  @raw_data = raw_data
  @period_signature = period_signature
end

Instance Attribute Details

#act_timeObject

Returns the value of attribute act_time.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def act_time
  @act_time
end

#parameter_treepathObject

Returns the value of attribute parameter_treepath.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def parameter_treepath
  @parameter_treepath
end

#period_listObject

Returns the value of attribute period_list.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def period_list
  @period_list
end

#period_signatureObject

Returns the value of attribute period_signature.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def period_signature
  @period_signature
end

#raw_dataObject

Returns the value of attribute raw_data.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def raw_data
  @raw_data
end

#registration_periodObject

Returns the value of attribute registration_period.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def registration_period
  @registration_period
end

#server_idObject

Returns the value of attribute server_id.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def server_id
  @server_id
end

#statusObject

Returns the value of attribute status.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def status
  @status
end

#val_timeObject

Returns the value of attribute val_time.



50
51
52
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 50

def val_time
  @val_time
end

Class Method Details

.construct(array_rep) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 64

def self.construct(array_rep)
  return nil if array_rep.nil?
  server_id = array_rep.shift
  act_time = SML::Time.construct(array_rep.shift)
  registration_period = array_rep.shift
  array_rep.shift unless registration_period.nil?
  parameter_treepath = SML::Treepath.construct(array_rep.shift)
  val_time = SML::Time.construct(array_rep.shift)
  status = array_rep.shift
  array_rep.shift unless status.nil?
  period_list = []
  array_rep.shift.each do |entry_array_rep|
    entry = SML::PeriodEntry.construct(entry_array_rep)
    return nil if entry.nil?
    period_list << entry
  end
  raw_data = array_rep.shift
  period_signature = array_rep.shift

  return nil if (act_time.nil? or parameter_treepath.nil? or val_time.nil?)
  return SML::GetProfileList::Response.new(server_id, act_time, registration_period, parameter_treepath, val_time, status, period_list, raw_data, period_signature)
end

Instance Method Details

#to_aObject



86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/ruby-sml/sml-getprofilelist.rb', line 86

def to_a
  period_list_array = []
  period_list.each do |entry|
    period_list_array << entry.to_a
  end

  result = [] << server_id << act_time.to_a << registration_period
  result << :uint32 unless registration_period.nil?
  result << parameter_treepath.to_a << val_time.to_a << status
  result << :uint64 unless status.nil?

  return result << period_list_array << raw_data << period_signature
end