Class: PgGraph::Data::DatabaseObject
- Defined in:
- lib/pg_graph/data/data.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
def ==(other) raise PgGraph::NotThis end.
-
#database ⇒ Object
The database (Data::Database) of this objectD.
- #dot(path) ⇒ Object
-
#guid ⇒ Object
Global unique id including database.
-
#initialize(*args, **opts) ⇒ DatabaseObject
constructor
A new instance of DatabaseObject.
-
#name ⇒ Object
Name of object.
-
#uid ⇒ Object
Unique id within a database.
Methods inherited from Node
#data, #inspect, #object, #to_h, #to_yaml, #value, #value_type
Constructor Details
#initialize(*args, **opts) ⇒ DatabaseObject
Returns a new instance of DatabaseObject.
67 68 69 70 |
# File 'lib/pg_graph/data/data.rb', line 67 def initialize(*args, **opts) super database.send(:add_object, self) end |
Instance Method Details
#<=>(other) ⇒ Object
def ==(other) raise PgGraph::NotThis end
74 |
# File 'lib/pg_graph/data/data.rb', line 74 def <=>(other) uid <=> other.uid end |
#database ⇒ Object
The database (Data::Database) of this objectD. It is defined “globally” because #dot requires quick access to the containing database
54 |
# File 'lib/pg_graph/data/data.rb', line 54 def database() raise NotThis end |
#dot(path) ⇒ Object
72 |
# File 'lib/pg_graph/data/data.rb', line 72 def dot(path) database.dot["#{uid}.#{path}"] end |
#guid ⇒ Object
Global unique id including database
62 |
# File 'lib/pg_graph/data/data.rb', line 62 def guid() type.guid end |
#name ⇒ Object
Name of object. Defaults to the name of the type
65 |
# File 'lib/pg_graph/data/data.rb', line 65 def name() type.name end |
#uid ⇒ Object
Unique id within a database. Note that #uid has to be defined before #initialize is called as it uses the UID as a key in the database-wide lookup table
59 |
# File 'lib/pg_graph/data/data.rb', line 59 def uid() type.uid end |