Class: OMF::OML::NetworkLink

Inherits:
NetworkElement show all
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

Attributes inherited from NetworkElement

#attributes, #el_id, #name

Instance Method Summary collapse

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

#fromObject

node



396
397
398
# File 'lib/omf_oml/network.rb', line 396

def from
  @from
end

#toObject

node



397
398
399
# File 'lib/omf_oml/network.rb', line 397

def to
  @to
end

Instance Method Details

#link?Boolean

Returns:

  • (Boolean)


422
423
424
# File 'lib/omf_oml/network.rb', line 422

def link?
  true
end