Class: Graphy::Entity
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #attrs(*values) ⇒ Object
-
#initialize(**params) ⇒ Entity
constructor
A new instance of Entity.
- #meths(*values) ⇒ Object
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 |