Class: Everywhere::Configuration
- Inherits:
-
Object
- Object
- Everywhere::Configuration
- Defined in:
- lib/everywhere.rb
Overview
App-facing runtime configuration. Apps register overrides at load time:
# config/initializers/everywhere.rb (Rails) or anywhere loaded by config.ru
Everywhere.configure do |c|
c.database { MyMigrator.run! } # override the default ORM-driven prep
end
Read back by the boot path (Everywhere::Database, etc.).
Instance Attribute Summary collapse
-
#database_hook ⇒ Object
readonly
A callable that fully owns database preparation.
-
#sequel_db ⇒ Object
An explicit Sequel database handle for frameworks (e.g. Hanami) where the connection lives inside a container rather than a top-level constant.
Instance Method Summary collapse
Instance Attribute Details
#database_hook ⇒ Object (readonly)
A callable that fully owns database preparation. When set, it replaces the ORM auto-detection in Everywhere::Database entirely.
25 26 27 |
# File 'lib/everywhere.rb', line 25 def database_hook @database_hook end |
#sequel_db ⇒ Object
An explicit Sequel database handle for frameworks (e.g. Hanami) where the connection lives inside a container rather than a top-level constant.
29 30 31 |
# File 'lib/everywhere.rb', line 29 def sequel_db @sequel_db end |
Instance Method Details
#database(&block) ⇒ Object
31 32 33 |
# File 'lib/everywhere.rb', line 31 def database(&block) @database_hook = block end |