Class: SPNet::OutPort
- Inherits:
-
Object
- Object
- SPNet::OutPort
- Includes:
- Hashmake::HashMakeable
- Defined in:
- lib/spnet/core/out_port.rb
Overview
A port that is used to exercise some functionality exposed by an InPort.
Direct Known Subclasses
Constant Summary collapse
- ARG_SPECS =
Define ArgSpec’s to use in processing hashed arguments during #initialize.
{ :matching_class => arg_spec(:reqd => true, :type => Class), }
Instance Attribute Summary collapse
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#matching_class ⇒ Object
readonly
Returns the value of attribute matching_class.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#clear_link ⇒ Object
Set @link to nil.
-
#initialize(args) ⇒ OutPort
constructor
A new instance of OutPort.
-
#linked? ⇒ Boolean
Return true if @link is not nil.
-
#set_link(link) ⇒ Object
Set @link to the given Link object.
Constructor Details
Instance Attribute Details
#link ⇒ Object (readonly)
Returns the value of attribute link.
14 15 16 |
# File 'lib/spnet/core/out_port.rb', line 14 def link @link end |
#matching_class ⇒ Object (readonly)
Returns the value of attribute matching_class.
14 15 16 |
# File 'lib/spnet/core/out_port.rb', line 14 def matching_class @matching_class end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/spnet/core/out_port.rb', line 14 def name @name end |
Instance Method Details
#clear_link ⇒ Object
Set @link to nil.
31 32 33 |
# File 'lib/spnet/core/out_port.rb', line 31 def clear_link @link = nil end |
#linked? ⇒ Boolean
Return true if @link is not nil.
36 37 38 |
# File 'lib/spnet/core/out_port.rb', line 36 def linked? !link.nil? end |
#set_link(link) ⇒ Object
Set @link to the given Link object.
25 26 27 28 |
# File 'lib/spnet/core/out_port.rb', line 25 def set_link link raise ArgumentError, "link 'from' port is not self" unless link.from == self @link = link end |