Class: SDN::Message::GetGroupAddr

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

Constant Summary collapse

MSG =
0x41
PARAMS_LENGTH =
1

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, group_index = 0, **kwargs) ⇒ GetGroupAddr

Returns a new instance of GetGroupAddr.



56
57
58
59
60
# File 'lib/sdn/messages/get.rb', line 56

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

Instance Attribute Details

#group_indexObject

Returns the value of attribute group_index.



54
55
56
# File 'lib/sdn/messages/get.rb', line 54

def group_index
  @group_index
end

Instance Method Details

#paramsObject



72
73
74
# File 'lib/sdn/messages/get.rb', line 72

def params
  transform_param(group_index)
end

#parse(params) ⇒ Object



62
63
64
65
# File 'lib/sdn/messages/get.rb', line 62

def parse(params)
  super
  self.group_index = to_number(params[0])
end