Class: SPNet::InPort
- Inherits:
-
Object
- Object
- SPNet::InPort
- Includes:
- Hashmake::HashMakeable
- Defined in:
- lib/spnet/core/in_port.rb
Overview
A port that exposes some functionality in a block.
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.
Instance Method Summary collapse
-
#clear_link ⇒ Object
Set @link to nil.
-
#initialize(args) ⇒ InPort
constructor
A new instance of InPort.
-
#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/in_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/in_port.rb', line 14 def matching_class @matching_class end |
Instance Method Details
#clear_link ⇒ Object
Set @link to nil.
31 32 33 |
# File 'lib/spnet/core/in_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/in_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/in_port.rb', line 25 def set_link link raise ArgumentError, "link 'to' port is not self" unless link.to == self @link = link end |