Class: OMF::OML::NetworkLink
- Inherits:
-
NetworkElement
- Object
- Base::LObject
- NetworkElement
- OMF::OML::NetworkLink
- Defined in:
- lib/omf_oml/network.rb
Overview
This class represents a network link between two nodes. Should NOT be created directly, but only through OmlNetwork#create_node method
Instance Attribute Summary collapse
-
#from ⇒ Object
node.
-
#to ⇒ Object
node.
Attributes inherited from NetworkElement
Instance Method Summary collapse
-
#initialize(name, fromNode, toNode, attributes, network) ⇒ NetworkLink
constructor
A new instance of NetworkLink.
- #link? ⇒ Boolean
Methods inherited from NetworkElement
#[], #[]=, #describe, #node?, #update
Constructor Details
#initialize(name, fromNode, toNode, attributes, network) ⇒ NetworkLink
Returns a new instance of NetworkLink.
405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/omf_oml/network.rb', line 405 def initialize(name, fromNode, toNode, attributes, network) super name, attributes, network if fromNode @fromNode = fromNode #puts ">>>> NODE: #{fromNode.inspect}" @attributes[:from_id] = fromNode.el_id end if toNode @toNode = toNode @attributes[:to_id] = toNode.el_id end end |
Instance Attribute Details
#from ⇒ Object
node
402 403 404 |
# File 'lib/omf_oml/network.rb', line 402 def from @from end |
#to ⇒ Object
node
403 404 405 |
# File 'lib/omf_oml/network.rb', line 403 def to @to end |
Instance Method Details
#link? ⇒ Boolean
428 429 430 |
# File 'lib/omf_oml/network.rb', line 428 def link? true end |