Class: PgGraph::Data::TableValue

Inherits:
Value
  • Object
show all
Defined in:
lib/pg_graph/data/value.rb

Instance Attribute Summary

Attributes inherited from Value

#referenced_object

Attributes inherited from Node

#dimension, #type

Instance Method Summary collapse

Methods inherited from Node

#data, #inspect, #object, #to_h, #to_yaml, #value, #value_type

Constructor Details

#initialize(table, records = []) ⇒ TableValue

Returns a new instance of TableValue.



29
30
31
32
33
34
35
# File 'lib/pg_graph/data/value.rb', line 29

def initialize(table, records = [])
  constrain table, Table
  constrain records, [Record]
  super(table.type, table, dimension: 2 )
  @impl = Table.new(table.schema, table.type)
  records.each { |r| @impl.send(:add_record, r) }
end