Class: PgCron::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_cron/configuration.rb

Constant Summary collapse

JOBS_DIRECTORY =

Kept for anything still referencing it. PgCron::Definition owns the real path; a literal rather than an interpolation of Definition::DIRECTORY so this does not depend on require order.

"db/cron"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter: PgCron::Adapters::Postgres.new) ⇒ Configuration

Returns a new instance of Configuration.



14
15
16
# File 'lib/pg_cron/configuration.rb', line 14

def initialize(adapter: PgCron::Adapters::Postgres.new)
  @adapter = adapter
end

Instance Attribute Details

#adapter ⇒ Object

The adapter used to run cron statements. Defaults to the Postgres adapter over the application's own connection.



12
13
14
# File 'lib/pg_cron/configuration.rb', line 12

def adapter
  @adapter
end

Instance Method Details

#connection ⇒ Object

Retained so PgCronRails.connection-era callers keep working.



21
22
23
# File 'lib/pg_cron/configuration.rb', line 21

def connection
  adapter
end