Class: RailsGraph::Graph::Relationships::Attribute

Inherits:
RailsGraph::Graph::Relationship show all
Defined in:
lib/rails_graph/graph/relationships/attribute.rb

Instance Attribute Summary

Attributes inherited from RailsGraph::Graph::Relationship

#label, #source, #target

Attributes inherited from Entity

#id, #name, #properties

Instance Method Summary collapse

Methods inherited from RailsGraph::Graph::Relationship

#as_json, #identifier

Methods inherited from Entity

#identifier

Constructor Details

#initialize(source, target) ⇒ Attribute



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rails_graph/graph/relationships/attribute.rb', line 9

def initialize(source, target)
  super(
    source: source,
    target: target,
    label: "HasAttribute",
    name: target.name,
    properties: {
      primary_key: source.properties[:primary_key] == target.name
    }
  )
end