Class: SDN::Message::GetMotorIP
- Inherits:
-
SDN::Message
- Object
- SDN::Message
- SDN::Message::GetMotorIP
- Defined in:
- lib/sdn/messages/get.rb
Constant Summary collapse
- MSG =
0x25
- PARAMS_LENGTH =
1
Instance Attribute Summary collapse
-
#ip ⇒ Object
Returns the value of attribute ip.
Attributes inherited from SDN::Message
#ack_requested, #dest, #reserved, #src
Instance Method Summary collapse
-
#initialize(dest = nil, ip = nil, **kwargs) ⇒ GetMotorIP
constructor
A new instance of GetMotorIP.
- #params ⇒ Object
- #parse(params) ⇒ Object
Methods inherited from SDN::Message
#class_inspect, #inspect, parse, #serialize
Methods included from Helpers
#checksum, #from_number, #from_string, #is_group_address?, #parse_address, #print_address, #to_number, #to_string, #transform_param
Constructor Details
#initialize(dest = nil, ip = nil, **kwargs) ⇒ GetMotorIP
Returns a new instance of GetMotorIP.
29 30 31 32 33 |
# File 'lib/sdn/messages/get.rb', line 29 def initialize(dest = nil, ip = nil, **kwargs) kwargs[:dest] ||= dest super(**kwargs) self.ip = ip end |
Instance Attribute Details
#ip ⇒ Object
Returns the value of attribute ip.
27 28 29 |
# File 'lib/sdn/messages/get.rb', line 27 def ip @ip end |
Instance Method Details
#params ⇒ Object
45 46 47 |
# File 'lib/sdn/messages/get.rb', line 45 def params transform_param(@ip || 0xff) end |
#parse(params) ⇒ Object
35 36 37 38 |
# File 'lib/sdn/messages/get.rb', line 35 def parse(params) super self.ip = to_number(params[0], nillable: true) end |