ruby/trema/send-out-port.rb in trema-0.2.5 vs ruby/trema/send-out-port.rb in trema-0.2.6
- old
+ new
@@ -26,21 +26,23 @@
#
class SendOutPort < Action
DEFAULT_MAX_LEN = 2 ** 16 - 1
+ # @return [Fixnum] the value of attribute {#max_len}
attr_reader :max_len
+ # @return [Fixnum] the value of attribute {#port_number}
attr_reader :port_number
#
# Creates an action to output a packet to a port.
#
# @example
# SendOutPort.new( 1 )
# SendOutPort.new( :port_number => 1 )
- # SendOutPort.new( :port_number => 1, :max_len => 256 )
+ # SendOutPort.new( :port_number => OFPP_CONTROLLER, :max_len => 256 )
#
# @param [Integer|Hash] options
# the port number or the options hash to create this action class instance with.
#
# @option options [Number] :port_number
@@ -79,17 +81,17 @@
def check_port_number
if @port_number.nil?
raise ArgumentError, "Port number is a mandatory option"
end
- if not @port_number.unsigned_16bit?
+ unless @port_number.unsigned_16bit?
raise ArgumentError, "Port number must be an unsigned 16-bit integer"
end
end
def check_max_len
- if not @max_len.unsigned_16bit?
+ unless @max_len.unsigned_16bit?
raise ArgumentError, "Max length must be an unsigned 16-bit integer"
end
end
end