Class: Flowckerc::Link
- Inherits:
-
Object
- Object
- Flowckerc::Link
- Defined in:
- lib/flowckerc/tokens.rb
Instance Attribute Summary collapse
-
#from_atom ⇒ Object
Returns the value of attribute from_atom.
-
#from_port ⇒ Object
Returns the value of attribute from_port.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#to_atom ⇒ Object
Returns the value of attribute to_atom.
-
#to_port ⇒ Object
Returns the value of attribute to_port.
Instance Method Summary collapse
-
#initialize(from_atom, from_port, to_atom, to_port) ⇒ Link
constructor
A new instance of Link.
- #toHash ⇒ Object
Constructor Details
#initialize(from_atom, from_port, to_atom, to_port) ⇒ Link
Returns a new instance of Link.
23 24 25 26 27 28 29 |
# File 'lib/flowckerc/tokens.rb', line 23 def initialize from_atom, from_port, to_atom, to_port @id = UniqueID.next @from_atom = from_atom @from_port = from_port @to_atom = to_atom @to_port = to_port end |
Instance Attribute Details
#from_atom ⇒ Object
Returns the value of attribute from_atom.
18 19 20 |
# File 'lib/flowckerc/tokens.rb', line 18 def from_atom @from_atom end |
#from_port ⇒ Object
Returns the value of attribute from_port.
19 20 21 |
# File 'lib/flowckerc/tokens.rb', line 19 def from_port @from_port end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/flowckerc/tokens.rb', line 17 def id @id end |
#to_atom ⇒ Object
Returns the value of attribute to_atom.
20 21 22 |
# File 'lib/flowckerc/tokens.rb', line 20 def to_atom @to_atom end |
#to_port ⇒ Object
Returns the value of attribute to_port.
21 22 23 |
# File 'lib/flowckerc/tokens.rb', line 21 def to_port @to_port end |
Instance Method Details
#toHash ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/flowckerc/tokens.rb', line 31 def toHash { id: @id, from: { atomID: @from_atom, port: { name: @from_port } }, to: { atomID: @to_atom, port: { name: @to_port } } } end |