Class: SML::GetList::Response
- Inherits:
-
Object
- Object
- SML::GetList::Response
- Defined in:
- lib/ruby-sml/sml-getlist.rb
Instance Attribute Summary collapse
-
#act_gateway_time ⇒ Object
Returns the value of attribute act_gateway_time.
-
#act_sensor_time ⇒ Object
Returns the value of attribute act_sensor_time.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#list_name ⇒ Object
Returns the value of attribute list_name.
-
#list_signature ⇒ Object
Returns the value of attribute list_signature.
-
#server_id ⇒ Object
Returns the value of attribute server_id.
-
#value_list ⇒ Object
Returns the value of attribute value_list.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client_id, server_id, list_name, act_sensor_time, value_list, list_signature, act_gateway_time) ⇒ Response
constructor
A new instance of Response.
- #to_a ⇒ Object
Constructor Details
#initialize(client_id, server_id, list_name, act_sensor_time, value_list, list_signature, act_gateway_time) ⇒ Response
Returns a new instance of Response.
44 45 46 47 48 49 50 51 52 |
# File 'lib/ruby-sml/sml-getlist.rb', line 44 def initialize(client_id, server_id, list_name, act_sensor_time, value_list, list_signature, act_gateway_time) @client_id = client_id @server_id = server_id @list_name = list_name @act_sensor_time = act_sensor_time @value_list = value_list @list_signature = list_signature @act_gateway_time = act_gateway_time end |
Instance Attribute Details
#act_gateway_time ⇒ Object
Returns the value of attribute act_gateway_time.
42 43 44 |
# File 'lib/ruby-sml/sml-getlist.rb', line 42 def act_gateway_time @act_gateway_time end |
#act_sensor_time ⇒ Object
Returns the value of attribute act_sensor_time.
42 43 44 |
# File 'lib/ruby-sml/sml-getlist.rb', line 42 def act_sensor_time @act_sensor_time end |
#client_id ⇒ Object
Returns the value of attribute client_id.
42 43 44 |
# File 'lib/ruby-sml/sml-getlist.rb', line 42 def client_id @client_id end |
#list_name ⇒ Object
Returns the value of attribute list_name.
42 43 44 |
# File 'lib/ruby-sml/sml-getlist.rb', line 42 def list_name @list_name end |
#list_signature ⇒ Object
Returns the value of attribute list_signature.
42 43 44 |
# File 'lib/ruby-sml/sml-getlist.rb', line 42 def list_signature @list_signature end |
#server_id ⇒ Object
Returns the value of attribute server_id.
42 43 44 |
# File 'lib/ruby-sml/sml-getlist.rb', line 42 def server_id @server_id end |
#value_list ⇒ Object
Returns the value of attribute value_list.
42 43 44 |
# File 'lib/ruby-sml/sml-getlist.rb', line 42 def value_list @value_list end |
Class Method Details
.construct(array_rep) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ruby-sml/sml-getlist.rb', line 54 def self.construct(array_rep) return nil if array_rep.nil? client_id = array_rep.shift server_id = array_rep.shift list_name = array_rep.shift act_sensor_time = SML::Time.construct(array_rep.shift) value_list = [] array_rep.shift.each do |entry_array_rep| entry = SML::ListEntry.construct(entry_array_rep) return nil if entry.nil? value_list << entry end list_signature = array_rep.shift act_gateway_time = SML::Time.construct(array_rep.shift) return SML::GetList::Response.new(client_id, server_id, list_name, act_sensor_time, value_list, list_signature, act_gateway_time) end |
Instance Method Details
#to_a ⇒ Object
76 77 78 79 80 81 82 83 |
# File 'lib/ruby-sml/sml-getlist.rb', line 76 def to_a value_list_array = [] value_list.each do |value| value_list_array << value.to_a end return [] << client_id << server_id << list_name << act_sensor_time.to_a << value_list_array << list_signature << act_gateway_time.to_a end |