Class: Graphy::Entity

Inherits:
Node
  • Object
show all
Defined in:
lib/graphy/entity.rb

Instance Attribute Summary

Attributes inherited from Node

#diagram, #name, #shape

Instance Method Summary collapse

Methods inherited from Node

#add_dependency, #build, for, #gnode, #to_s

Constructor Details

#initialize(**params) ⇒ Entity

Returns a new instance of Entity.



3
4
5
6
# File 'lib/graphy/entity.rb', line 3

def initialize(**params)
  super(**params.merge(shape: 'Mrecord'))
  @attributes = []
end

Instance Method Details

#attrs(*values) ⇒ Object



8
9
10
# File 'lib/graphy/entity.rb', line 8

def attrs(*values)
  @attributes = values
end

#meths(*values) ⇒ Object



12
13
14
# File 'lib/graphy/entity.rb', line 12

def meths(*values)
  @attributes << values.map { |x| "#{x}()"}
end