lib/visualize_ruby/edge.rb in visualize_ruby-0.11.0 vs lib/visualize_ruby/edge.rb in visualize_ruby-0.16.0
- old
+ new
@@ -1,18 +1,22 @@
module VisualizeRuby
class Edge
+ include Namable
+ add_names :label
include Touchable
include Optionalable
attr_reader :nodes,
:dir,
- :style
+ :style,
+ :type,
+ :label
attr_accessor :color,
:display
def initialize(name: nil, nodes:, dir: :forward, type: :default, display: :visual, **opts)
- @name = name.to_s if name
+ @label = name.to_s if name
@nodes = nodes
@dir = dir
@style = style
@color = color
@type = type
@@ -29,10 +33,10 @@
end
def to_a
[
node_a.name.to_s,
- name,
+ label,
direction_symbol,
node_b.name.to_s,
].compact
end