Module: PgGraph::Data

Defined in:
lib/pg_graph.rb,
lib/pg_graph/data/data.rb,
lib/pg_graph/data/read.rb,
lib/pg_graph/data/value.rb,
lib/pg_graph/data/render.rb,
lib/pg_graph/data/dimension.rb,
lib/pg_graph/data/association.rb

Defined Under Namespace

Classes: Association, AssociationField, Column, Database, DatabaseObject, Dimension, Error, Field, KindAssociation, KindRecordField, LinkAssociation, MmTableField, MmTableValue, Node, Record, RecordField, RecordValue, Schema, SqlRender, Table, TableField, TableValue, Value

Class Method Summary collapse

Class Method Details

.===(element) ⇒ Object

Make the Data module pretend to have Database object instances



107
# File 'lib/pg_graph.rb', line 107

def self.===(element) element.is_a?(PgGraph::Data::Connection) or super end

.new(type, arg) ⇒ Object

:call-seq:

new(type, hash = {})
new(type, yaml = {})
new(type, pg_conn = nil)

Note that together with ::=== and Data::Database#is_a? this makes Data::Database pretend it is an instance of the Data module



100
101
102
103
104
# File 'lib/pg_graph.rb', line 100

def self.new(type, arg)
  constrain type, PgGraph::Type
  constrain arg, Hash, PgConn, NilClass
  Database.new(type, arg)
end