Class: SDN::Message::SetNodeLabel

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

Constant Summary collapse

MSG =
0x55
PARAMS_LENGTH =
16

Instance Attribute Summary collapse

Attributes inherited from SDN::Message

#ack_requested, #dest, #reserved, #src

Instance Method Summary collapse

Methods inherited from SDN::Message

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

Returns a new instance of SetNodeLabel.



215
216
217
218
219
# File 'lib/sdn/messages/set.rb', line 215

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.



213
214
215
# File 'lib/sdn/messages/set.rb', line 213

def label
  @label
end

Instance Method Details

#paramsObject



225
226
227
# File 'lib/sdn/messages/set.rb', line 225

def params
  from_string(label, 16)
end

#parse(params) ⇒ Object



221
222
223
# File 'lib/sdn/messages/set.rb', line 221

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