Module: PgOnlineSchemaChange::Helper

Included in:
Orchestrate, Query, Replay
Defined in:
lib/pg_online_schema_change/helper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *_args) ⇒ Object



16
17
18
19
20
21
# File 'lib/pg_online_schema_change/helper.rb', line 16

def method_missing(method, *_args)
  result = Store.send(:get, method)
  return result if result

  super
end

Instance Method Details

#loggerObject



12
13
14
# File 'lib/pg_online_schema_change/helper.rb', line 12

def logger
  PgOnlineSchemaChange.logger
end

#primary_keyObject



5
6
7
8
9
10
# File 'lib/pg_online_schema_change/helper.rb', line 5

def primary_key
  result = Store.get(:primary_key)
  return result if result

  Store.set(:primary_key, Query.primary_key_for(client, client.table_name))
end

#respond_to_missing?(method_name, *args) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
27
28
# File 'lib/pg_online_schema_change/helper.rb', line 23

def respond_to_missing?(method_name, *args)
  result = Store.send(:get, method)
  return true if result

  super
end