Class: RuTu::Edge
- Inherits:
-
Object
- Object
- RuTu::Edge
- Defined in:
- lib/RuTu.rb
Instance Method Summary collapse
-
#initialize(from, to, relation, options = {}) ⇒ Edge
constructor
A new instance of Edge.
- #same?(from, to, relation) ⇒ Boolean
- #to_dot(to_set) ⇒ Object
Constructor Details
#initialize(from, to, relation, options = {}) ⇒ Edge
Returns a new instance of Edge.
117 118 119 |
# File 'lib/RuTu.rb', line 117 def initialize(from, to, relation, = {}) @from, @to, @relation, @options = from, to, relation, end |
Instance Method Details
#same?(from, to, relation) ⇒ Boolean
120 121 122 |
# File 'lib/RuTu.rb', line 120 def same?(from, to, relation) @from == from && @to == to && @relation == relation end |
#to_dot(to_set) ⇒ Object
123 124 125 126 |
# File 'lib/RuTu.rb', line 123 def to_dot(to_set) "#{@from.node_id}:#{@relation} -> #{@to.node_id}:header [ label = #{@relation} ]" + ((@relation == "klass" && to_set.add?(@to)) ? "{ rank = same; #{@from.node_id}; #{@to.node_id}; }" : "") end |