Class: SetNwDstAction
- Defined in:
- lib/openflowdev/actions/set_nw_dst_action.rb
Overview
Class to define OpenFlow action to set the destination IP (network layer) address
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(order: nil, ip_addr: nil) ⇒ SetNwDstAction
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, ip_addr: nil) ⇒ SetNwDstAction
Parameters
order-
integer : The order of the action relative to other actions in Instruction.
ip_addr-
string : The destination IP address to set.
37 38 39 40 41 |
# File 'lib/openflowdev/actions/set_nw_dst_action.rb', line 37 def initialize(order: nil, ip_addr: nil) super(order: order) raise ArgumentError, "IP Address (ip_addr) required" unless ip_addr @ip = ip_addr end |
Instance Method Details
#to_hash ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/openflowdev/actions/set_nw_dst_action.rb', line 43 def to_hash #:nodoc: {:order => @order, 'set-nw-dst-action' => {:address => @ip}} end |