Class: SML::GetProfilePack::Response

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_id, act_time, register_period, parameter_treepath, header_list, period_list, raw_data, profile_signature) ⇒ Response

Returns a new instance of Response.



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

def initialize(server_id, act_time, register_period, parameter_treepath, header_list, period_list, raw_data, profile_signature)
  @server_id = server_id
  @act_time = act_time
  @register_period = register_period
  @parameter_treepath = parameter_treepath
  @header_list = header_list
  @period_list = period_list
  @raw_data = raw_data
  @profile_signature = profile_signature
end

Instance Attribute Details

#act_timeObject

Returns the value of attribute act_time.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def act_time
  @act_time
end

#header_listObject

Returns the value of attribute header_list.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def header_list
  @header_list
end

#parameter_treepathObject

Returns the value of attribute parameter_treepath.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def parameter_treepath
  @parameter_treepath
end

#period_listObject

Returns the value of attribute period_list.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def period_list
  @period_list
end

#profile_signatureObject

Returns the value of attribute profile_signature.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def profile_signature
  @profile_signature
end

#raw_dataObject

Returns the value of attribute raw_data.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def raw_data
  @raw_data
end

#register_periodObject

Returns the value of attribute register_period.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def register_period
  @register_period
end

#server_idObject

Returns the value of attribute server_id.



51
52
53
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 51

def server_id
  @server_id
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
86
87
88
# File 'lib/ruby-sml/sml-getprofilepack.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)
  header_list = []
  array_rep.shift.each do |entry_array_rep|
    entry = SML::ProfileObjectHeaderEntry.construct(entry_array_rep)
    return nil if entry.nil?
    header_list << entry
  end
  period_list = []
  array_rep.shift.each do |entry_array_rep|
    entry = SML::ProfileObjectPeriodEntry.construct(entry_array_rep)
    return nil if entry.nil?
    period_list << entry
  end
  raw_data = array_rep.shift
  profile_signature = array_rep.shift

  return nil if (act_time.nil? or parameter_treepath.nil?)
  return SML::GetProfilePack::Response.new(server_id, act_time, registration_period, parameter_treepath, header_list, period_list, raw_data, profile_signature)
end

Instance Method Details

#to_aObject



89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/ruby-sml/sml-getprofilepack.rb', line 89

def to_a
  header_list_array = []
  header_list.each do |entry|
    header_list_array << entry.to_a
  end
  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?
  return result << parameter_treepath.to_a << header_list_array << period_list_array << raw_data << profile_signature
end