class NetworkDrawer::Element::Connection
Replesent of connection
Constants
- DEFAULT_STYLE
Public Class Methods
new(initial_values = {}, style = {})
click to toggle source
Calls superclass method
# File lib/network_drawer/element/connection.rb, line 9 def initialize(initial_values = {}, style = {}) super @default_style = DEFAULT_STYLE end
Public Instance Methods
to_code()
click to toggle source
# File lib/network_drawer/element/connection.rb, line 14 def to_code style = style(self.type).dup style.merge!(self.to_hash) cid = "#{self.from}_#{self.to}_#{self.id}".gsub('/', '').to_sym "edge(:\"#{cid}\", #{style})\n" end