Class: RailsGraph::Graph::Node
- Defined in:
- lib/rails_graph/graph/node.rb
Direct Known Subclasses
RailsGraph::Graph::Nodes::AbstractModel, RailsGraph::Graph::Nodes::Column, RailsGraph::Graph::Nodes::Database, RailsGraph::Graph::Nodes::Gem, RailsGraph::Graph::Nodes::Model, RailsGraph::Graph::Nodes::Pack, RailsGraph::Graph::Nodes::Table, RailsGraph::Graph::Nodes::VirtualModel
Instance Attribute Summary collapse
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
Attributes inherited from Entity
Instance Method Summary collapse
- #as_json(_options = nil) ⇒ Object
-
#initialize(labels: [], **opts) ⇒ Node
constructor
A new instance of Node.
Methods inherited from Entity
Constructor Details
#initialize(labels: [], **opts) ⇒ Node
Returns a new instance of Node.
10 11 12 13 14 |
# File 'lib/rails_graph/graph/node.rb', line 10 def initialize(labels: [], **opts) @labels = Array(labels) super(**opts) end |
Instance Attribute Details
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
8 9 10 |
# File 'lib/rails_graph/graph/node.rb', line 8 def labels @labels end |
Instance Method Details
#as_json(_options = nil) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/rails_graph/graph/node.rb', line 16 def as_json( = nil) { id: id, labels: labels, name: name, properties: properties } end |