Class: GroupAction
- Defined in:
- lib/openflowdev/actions/group_action.rb
Overview
Class to define an action to forward to a group
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(order: nil, group: nil, group_id: nil) ⇒ GroupAction
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, group: nil, group_id: nil) ⇒ GroupAction
Parameters
order-
integer : The order of the action relative to other actions in Instruction.
group
group_id-
integer : Identifier for the target group.
38 39 40 41 42 43 44 |
# File 'lib/openflowdev/actions/group_action.rb', line 38 def initialize(order: nil, group: nil, group_id: nil) super(order: order) raise ArgumentError, "Group (group) required" unless group raise ArgumentError, "Group ID (group_id) required" unless group_id @group = group @group_id = group_id end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
46 47 48 49 |
# File 'lib/openflowdev/actions/group_action.rb', line 46 def to_hash #:nodoc: {:order => @order, 'group-action' => {:group => @group, 'group-id' => @group_id}} end |