Class: SetVlanIdAction
- Defined in:
- lib/openflowdev/actions/set_vlan_id_action.rb
Overview
Class to define OpenFlow action that will set the VLAN identifier in VLAN header
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(order: nil, vlan_id: nil) ⇒ SetVlanIdAction
constructor
- Parameters *
order -
integer : The order of the action relative to other actions in Instruction.
- Parameters *
-
#to_hash ⇒ Object
:nodoc:.
Constructor Details
#initialize(order: nil, vlan_id: nil) ⇒ SetVlanIdAction
Parameters
order-
integer : The order of the action relative to other actions in Instruction.
vlan_id-
integer : The VLAN identifier to set in VLAN header.
37 38 39 40 41 |
# File 'lib/openflowdev/actions/set_vlan_id_action.rb', line 37 def initialize(order: nil, vlan_id: nil) super(order: order) raise ArgumentError, "VLAN ID (vlan_id) required" unless vlan_id @vlan_id = vlan_id end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/openflowdev/actions/set_vlan_id_action.rb', line 43 def to_hash #:nodoc: {:order => @order, 'set-vlan-id-action' => {'vlan-id' => @vlan_id}} end |