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.



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

#fromObject

node



402
403
404
# File 'lib/omf_oml/network.rb', line 402

def from
  @from
end

#toObject

node



403
404
405
# File 'lib/omf_oml/network.rb', line 403

def to
  @to
end

Instance Method Details

#link?Boolean

Returns:

  • (Boolean)


428
429
430
# File 'lib/omf_oml/network.rb', line 428

def link?
  true
end