Class: SDN::Message::SetNetworkLock

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

Constant Summary collapse

MSG =
0x16

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, #initialize, #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

This class inherits a constructor from SDN::Message

Instance Attribute Details

#lockedObject

Returns the value of attribute locked.



212
213
214
# File 'lib/sdn/message/set.rb', line 212

def locked
  @locked
end

#priorityObject

Returns the value of attribute priority.



212
213
214
# File 'lib/sdn/message/set.rb', line 212

def priority
  @priority
end

Instance Method Details

#paramsObject



219
220
221
# File 'lib/sdn/message/set.rb', line 219

def params
  transform_param(locked ? 1 : 0) + transform_param(priority)
end

#parse(params) ⇒ Object



214
215
216
217
# File 'lib/sdn/message/set.rb', line 214

def parse(params)
  self.locked = to_number(params[0]) == 1 ? true : false
  self.priority = to_number(params[1])
end