Class: SDN::Message::ILT2::GetMotorIP

Inherits:
SDN::Message show all
Defined in:
lib/sdn/message/ilt2/get.rb

Constant Summary collapse

MSG =
0x43
PARAMS_LENGTH =
1

Instance Attribute Summary collapse

Attributes inherited from SDN::Message

#ack_requested, #dest, #node_type, #src

Instance Method Summary collapse

Methods inherited from SDN::Message

#==, #class_inspect, expected_response?, inherited, #inspect, parse, #serialize

Methods included from Helpers

#checksum, #from_number, #from_string, #is_group_address?, #node_type_from_number, #node_type_to_number, #node_type_to_string, #parse_address, #print_address, #to_number, #to_string, #transform_param

Constructor Details

#initialize(dest = nil, ip = 1, **kwargs) ⇒ GetMotorIP

Returns a new instance of GetMotorIP.



18
19
20
21
22
# File 'lib/sdn/message/ilt2/get.rb', line 18

def initialize(dest = nil, ip = 1, **kwargs)
  kwargs[:dest] ||= dest
  super(**kwargs)
  self.ip = ip
end

Instance Attribute Details

#ipObject

Returns the value of attribute ip.



16
17
18
# File 'lib/sdn/message/ilt2/get.rb', line 16

def ip
  @ip
end

Instance Method Details

#paramsObject



34
35
36
# File 'lib/sdn/message/ilt2/get.rb', line 34

def params
  transform_param(@ip - 1)
end

#parse(params) ⇒ Object



29
30
31
32
# File 'lib/sdn/message/ilt2/get.rb', line 29

def parse(params)
  super
  self.ip = to_number(params[0]) + 1
end