Class: RailsGraph::Graph::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_graph/graph/entity.rb

Direct Known Subclasses

Node, Relationship

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, id: SecureRandom.uuid, properties: {}) ⇒ Entity

Returns a new instance of Entity.



10
11
12
13
14
# File 'lib/rails_graph/graph/entity.rb', line 10

def initialize(name:, id: SecureRandom.uuid, properties: {})
  @id = id
  @name = name
  @properties = properties
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#propertiesObject (readonly)

Returns the value of attribute properties.



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

def properties
  @properties
end

Instance Method Details

#identifierObject



16
17
18
# File 'lib/rails_graph/graph/entity.rb', line 16

def identifier
  id
end