Class: RailsGraph::Graph::Nodes::Model

Inherits:
RailsGraph::Graph::Node show all
Defined in:
lib/rails_graph/graph/nodes/model.rb

Instance Attribute Summary collapse

Attributes inherited from RailsGraph::Graph::Node

#labels

Attributes inherited from Entity

#id, #name, #properties

Instance Method Summary collapse

Methods inherited from RailsGraph::Graph::Node

#as_json

Constructor Details

#initialize(model) ⇒ Model

Returns a new instance of Model.



11
12
13
14
15
# File 'lib/rails_graph/graph/nodes/model.rb', line 11

def initialize(model)
  @model = model

  super(labels: "Model", name: model.name, properties: build_properties)
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



9
10
11
# File 'lib/rails_graph/graph/nodes/model.rb', line 9

def model
  @model
end

Instance Method Details

#identifierObject



17
18
19
# File 'lib/rails_graph/graph/nodes/model.rb', line 17

def identifier
  RailsGraph::Helpers::Models.identifier(model)
end