Class: SPNet::ParamOutPort

Inherits:
OutPort
  • Object
show all
Defined in:
lib/spnet/ports/param_out_port.rb

Overview

Output value to a connected ParamInPort object.

Author:

  • James Tunnell

Constant Summary

Constants inherited from OutPort

OutPort::ARG_SPECS

Instance Attribute Summary

Attributes inherited from OutPort

#link, #matching_class, #name

Instance Method Summary collapse

Methods inherited from OutPort

#clear_link, #linked?, #set_link

Constructor Details

#initializeParamOutPort

A new instance of ParamOutPort.



9
10
11
# File 'lib/spnet/ports/param_out_port.rb', line 9

def initialize
  super(:matching_class => ParamInPort)
end

Instance Method Details

#get_valueObject

If linked, return the result of calling the connected ParamInPort object’s get_value method. Otherwise, return false.



24
25
26
27
28
29
# File 'lib/spnet/ports/param_out_port.rb', line 24

def get_value
  if linked?
    return @link.to.get_value
  end
  return false
end

#set_value(value) ⇒ Object

If linked, return the result of calling the connected ParamInPort object’s set_value method. Otherwise, return false.



15
16
17
18
19
20
# File 'lib/spnet/ports/param_out_port.rb', line 15

def set_value value
  if linked?
    return @link.to.set_value value
  end
  return false
end