Method: PgGraph::Data::Association#initialize

Defined in:
lib/pg_graph/data/association.rb

#initialize(dimension, this_table, that_table, this_field, that_field) ⇒ Association

Returns a new instance of Association.



11
12
13
14
15
16
17
18
19
20
# File 'lib/pg_graph/data/association.rb', line 11

def initialize(dimension, this_table, that_table, this_field, that_field)
  Dimension.validate(dimension, min: 1)
  constrain this_table, Table
  constrain that_table, Table
  constrain this_field, String, Symbol
  constrain that_field, String, Symbol
  @dimension = dimension
  @this_table, @this_field = this_table, this_field
  @that_table, @that_field = that_table, that_field
end