Class: SDN::Message::SetNodeLabel

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

Direct Known Subclasses

ILT2::SetNodeLabel

Constant Summary collapse

MSG =
0x55
MAX_LENGTH =
16

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, #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, label = "", **kwargs) ⇒ SetNodeLabel

Returns a new instance of SetNodeLabel.



256
257
258
259
260
# File 'lib/sdn/message/set.rb', line 256

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

Instance Attribute Details

#labelObject

Returns the value of attribute label.



254
255
256
# File 'lib/sdn/message/set.rb', line 254

def label
  @label
end

Instance Method Details

#paramsObject



266
267
268
# File 'lib/sdn/message/set.rb', line 266

def params
  from_string(label, self.class::MAX_LENGTH)
end

#parse(params) ⇒ Object



262
263
264
# File 'lib/sdn/message/set.rb', line 262

def parse(params)
  self.label = to_string(params)
end