class Graphy::Entity

Public Class Methods

new(**params) click to toggle source
Calls superclass method
# File lib/graphy/entity.rb, line 3
def initialize(**params)
  super(**params.merge(shape: 'Mrecord'))
  @attributes = []
end

Public Instance Methods

attrs(*values) click to toggle source
# File lib/graphy/entity.rb, line 8
def attrs(*values)
  @attributes = values
end
meths(*values) click to toggle source
# File lib/graphy/entity.rb, line 12
def meths(*values)
  @attributes << values.map { |x| "#{x}()"}
end

Protected Instance Methods

draw_edge(dependency, **options) click to toggle source
# File lib/graphy/entity.rb, line 18
def draw_edge(dependency, **options)
  diagram.draw_edge(dependency.gnode, gnode, options)
end
label() click to toggle source
# File lib/graphy/entity.rb, line 22
def label
  "{ #{name} #{attributes_label} }"
end

Private Instance Methods

attributes_label() click to toggle source
# File lib/graphy/entity.rb, line 28
def attributes_label
  return if @attributes.empty?
  "| #{@attributes.join("\n")}"
end