Class: Architect::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/architect/edge.rb

Overview

This is a generic edge in a graph which connects two nodes

Direct Known Subclasses

Association

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node1, node2) ⇒ Edge

Returns a new instance of Edge.



9
10
11
12
13
14
# File 'lib/architect/edge.rb', line 9

def initialize(node1, node2)
  raise node1.to_s + " must be a Node" unless node1.kind_of? Node 
  raise node2.to_s + " must be a Node" unless node2.kind_of? Node 
  @node1 = node1
  @node2 = node2
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



7
8
9
# File 'lib/architect/edge.rb', line 7

def from
  @from
end

#toObject

Returns the value of attribute to.



7
8
9
# File 'lib/architect/edge.rb', line 7

def to
  @to
end