Module: EventSourcery::Postgres::TableOwner::ClassMethods

Defined in:
lib/event_sourcery/postgres/table_owner.rb

Instance Method Summary collapse

Instance Method Details

#table(name, &block) ⇒ Object

For the given table name assign to give block as the value.

Parameters:

  • name

    the name of the table

  • block

    the block of code to assign for the table



23
24
25
# File 'lib/event_sourcery/postgres/table_owner.rb', line 23

def table(name, &block)
  tables[name] = block
end

#tablesHash

Hash of the tables and their corresponding blocks.

Returns:

  • (Hash)

    hash keyed by table names and block values



15
16
17
# File 'lib/event_sourcery/postgres/table_owner.rb', line 15

def tables
  @tables ||= {}
end