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

Returns a new instance of SetNodeLabel.



230
231
232
233
234
# File 'lib/sdn/message/set.rb', line 230

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.



228
229
230
# File 'lib/sdn/message/set.rb', line 228

def label
  @label
end

Instance Method Details

#paramsObject



240
241
242
# File 'lib/sdn/message/set.rb', line 240

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

#parse(params) ⇒ Object



236
237
238
# File 'lib/sdn/message/set.rb', line 236

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