Class: SetVlanPCPAction
- Defined in:
- lib/openflowdev/actions/set_vlan_pcp_action.rb
Overview
Class used to define OpenFlow action to set the PCP field in VLAN header
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(order: nil, vlan_pcp: nil) ⇒ SetVlanPCPAction
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_pcp: nil) ⇒ SetVlanPCPAction
Parameters
order-
integer : The order of the action relative to other actions in Instruction.
vlan_pcp-
integer : The valoue to set in the PCP field in VLAN header.
37 38 39 40 41 |
# File 'lib/openflowdev/actions/set_vlan_pcp_action.rb', line 37 def initialize(order: nil, vlan_pcp: nil) super(order: order) raise ArgumentError, "VLAN PCP (vlan_pcp) required" unless vlan_pcp @vlan_pcp = vlan_pcp end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/openflowdev/actions/set_vlan_pcp_action.rb', line 43 def to_hash #:nodoc: {:order => @order, 'set-vlan-pcp-action' => {'vlan-pcp' => @vlan_pcp}} end |