Class: RailsGraph::Graph::Relationships::Association

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

Instance Attribute Summary collapse

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(association, source, target) ⇒ Association

Returns a new instance of Association.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rails_graph/graph/relationships/association.rb', line 11

def initialize(association, source, target)
  @association = association

  super(
    source: source,
    target: target,
    label: association.macro.to_s.camelize,
    name: association.name.to_s,
    properties: build_properties
  )
end

Instance Attribute Details

#associationObject (readonly)

Returns the value of attribute association.



9
10
11
# File 'lib/rails_graph/graph/relationships/association.rb', line 9

def association
  @association
end