class SPNet::ParamInPort
Provides a means to get/set a parameter value in a Block
object.
@author James Tunnell
Constants
- ARG_SPECS
Define arg specs to use in processing hashed arguments during initialize.
Attributes
limiter[R]
Public Class Methods
new(hashed_args = {})
click to toggle source
A new instance of ParamInPort
. @param [Hash] hashed_args Hashed arguments for initialization. See Network::ARG_SPECS
for details.
Calls superclass method
SPNet::InPort::new
# File lib/spnet/ports/param_in_port.rb, line 22 def initialize hashed_args = {} hash_make hashed_args, ParamInPort::ARG_SPECS @skip_limiting = @limiter.is_a?(NoLimiter) super(:matching_class => ParamOutPort) end
Public Instance Methods
get_value()
click to toggle source
Get the parameter's current value.
# File lib/spnet/ports/param_in_port.rb, line 38 def get_value @get_value_handler.call end
set_value(value)
click to toggle source
Set the parameter to the given value.
# File lib/spnet/ports/param_in_port.rb, line 30 def set_value value unless @skip_limiting value = @limiter.apply_limit value, get_value end @set_value_handler.call value end