Class: SDN::Message::GetGroupAddr

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

Constant Summary collapse

MSG =
0x41
PARAMS_LENGTH =
1

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

Returns a new instance of GetGroupAddr.



9
10
11
12
13
# File 'lib/sdn/message/get.rb', line 9

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

Instance Attribute Details

#group_indexObject

Returns the value of attribute group_index.



7
8
9
# File 'lib/sdn/message/get.rb', line 7

def group_index
  @group_index
end

Instance Method Details

#paramsObject



25
26
27
# File 'lib/sdn/message/get.rb', line 25

def params
  transform_param(group_index - 1)
end

#parse(params) ⇒ Object



15
16
17
18
# File 'lib/sdn/message/get.rb', line 15

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