Class: PgGraph::Data::Node
- Inherits:
-
Object
- Object
- PgGraph::Data::Node
- Defined in:
- lib/pg_graph/data/data.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#dimension ⇒ Object
readonly
Dimension of the node.
-
#type ⇒ Object
readonly
Type of the node (a PgGraph::Type::Node object).
Instance Method Summary collapse
-
#data ⇒ Object
Node converted to plain ruby objects structured as given by #dimension.
-
#initialize(type, dimension: nil) ⇒ Node
constructor
A new instance of Node.
- #inspect(payload = inspect_inner) ⇒ Object
-
#object ⇒ Object
Usually the node itself but associations redefines this to be the associated object.
- #to_h ⇒ Object
- #to_yaml ⇒ Object
-
#value ⇒ Object
Node converted to plain ruby objects structured as given by the dimension kind but with flattened M:M associations so duplicates can happen.
-
#value_type ⇒ Object
Type of the value of a node.
Constructor Details
Instance Attribute Details
#dimension ⇒ Object (readonly)
Dimension of the node
17 18 19 |
# File 'lib/pg_graph/data/data.rb', line 17 def dimension @dimension end |
#type ⇒ Object (readonly)
Type of the node (a PgGraph::Type::Node object)
11 12 13 |
# File 'lib/pg_graph/data/data.rb', line 11 def type @type end |
Instance Method Details
#data ⇒ Object
Node converted to plain ruby objects structured as given by #dimension. This is the same as #value except for M:M associations
28 |
# File 'lib/pg_graph/data/data.rb', line 28 def data() @impl end |
#inspect(payload = inspect_inner) ⇒ Object
40 41 42 |
# File 'lib/pg_graph/data/data.rb', line 40 def inspect(payload = inspect_inner) "#<#{self.class}:#{uid}#{payload ? " #{payload}" : ""}>" end |
#object ⇒ Object
Usually the node itself but associations redefines this to be the associated object. It is used in client code to reference the value object of an associated field, ie: node.object.value() will give you the value of a field even if the field is an association
38 |
# File 'lib/pg_graph/data/data.rb', line 38 def object() self end |
#to_h ⇒ Object
44 |
# File 'lib/pg_graph/data/data.rb', line 44 def to_h() raise NotThis end |
#to_yaml ⇒ Object
45 |
# File 'lib/pg_graph/data/data.rb', line 45 def to_yaml() raise NotThis end |
#value ⇒ Object
Node converted to plain ruby objects structured as given by the dimension kind but with flattened M:M associations so duplicates can happen
32 |
# File 'lib/pg_graph/data/data.rb', line 32 def value() data end |
#value_type ⇒ Object
Type of the value of a node
14 |
# File 'lib/pg_graph/data/data.rb', line 14 def value_type() type end |