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.
399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'lib/omf_oml/network.rb', line 399 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
396 397 398 |
# File 'lib/omf_oml/network.rb', line 396 def from @from end |
#to ⇒ Object
node
397 398 399 |
# File 'lib/omf_oml/network.rb', line 397 def to @to end |
Instance Method Details
#link? ⇒ Boolean
422 423 424 |
# File 'lib/omf_oml/network.rb', line 422 def link? true end |