class AlgebraDB::Def::Relationship
Defines a relationship between two tables.
Public Class Methods
new(joined_table, relater_proc)
click to toggle source
# File lib/algebra_db/def/relationship.rb, line 6 def initialize(joined_table, relater_proc) @joined_table = joined_table @relater_proc = relater_proc end
Public Instance Methods
join_clause(joined_relation)
click to toggle source
# File lib/algebra_db/def/relationship.rb, line 11 def join_clause(joined_relation) @relater_proc.call(joined_relation) end
joined_table()
click to toggle source
# File lib/algebra_db/def/relationship.rb, line 15 def joined_table @joined_table.is_a?(Proc) ? @joined_table.call : @joined_table end