Class: Pio::OpenFlow10::SetVlanPriority
- Inherits:
-
Pio::OpenFlow::Action
- Object
- Pio::OpenFlow::Action
- Pio::OpenFlow10::SetVlanPriority
- 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
-
#initialize(number) ⇒ SetVlanPriority
constructor
A new instance of SetVlanPriority.
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 |