lib/visualize_ruby/edge.rb in visualize_ruby-0.2.1 vs lib/visualize_ruby/edge.rb in visualize_ruby-0.5.0
- old
+ new
@@ -1,23 +1,26 @@
module VisualizeRuby
class Edge
attr_reader :name,
:node_a,
:node_b,
- :dir
- def initialize(name: nil, nodes:, dir: :forward)
+ :dir,
+ :style
+
+ def initialize(name: nil, nodes:, dir: :forward, style: :solid)
@name = name.to_s if name
@node_a = nodes[0]
@node_b = nodes[1]
@dir = dir
+ @style = style
end
def to_a
[
- node_a.to_sym,
+ node_a.name.to_s,
name,
direction_symbol,
- node_b.to_sym,
+ node_b.name.to_s,
].compact
end
def direction_symbol
case dir