Class: Pio::OpenFlow10::SetVlanPriority

Inherits:
Pio::OpenFlow::Action show all
Defined in:
lib/pio/open_flow10/set_vlan_priority.rb

Overview

An action to modify the VLAN priority of a packet.

Instance Method Summary collapse

Methods inherited from Pio::OpenFlow::Action

action_header, method_missing, read, #to_binary

Constructor Details

#initialize(number) ⇒ SetVlanPriority

Returns a new instance of SetVlanPriority.



14
15
16
17
18
19
20
21
22
# File 'lib/pio/open_flow10/set_vlan_priority.rb', line 14

def initialize(number)
  priority = number.to_i
  if priority < 0 || priority > 7
    raise ArgumentError, 'VLAN priority must be between 0 and 7 inclusive'
  end
  super(vlan_priority: priority)
rescue NoMethodError
  raise TypeError, 'VLAN priority must be an Integer.'
end