Class: Hanami::Providers::DB::Adapter
- Inherits:
-
Object
- Object
- Hanami::Providers::DB::Adapter
- Includes:
- Dry::Configurable
- Defined in:
- lib/hanami/providers/db/adapter.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
- #clear ⇒ Object
- #configure_for_database(database_url) ⇒ Object private
- #configure_from_adapter(other_adapter) ⇒ Object private
- #gateway_cache_keys ⇒ Object private
- #gateway_options ⇒ Object private
-
#initialize ⇒ Adapter
constructor
private
A new instance of Adapter.
- #plugin(**plugin_spec, &config_block) ⇒ Object
- #plugins ⇒ Object
- #skip_defaults(setting_name = nil) ⇒ Object
Constructor Details
#initialize ⇒ Adapter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Adapter.
18 19 20 |
# File 'lib/hanami/providers/db/adapter.rb', line 18 def initialize(...) @skip_defaults = Hash.new(false) end |
Instance Method Details
#clear ⇒ Object
68 69 70 71 |
# File 'lib/hanami/providers/db/adapter.rb', line 68 def clear config.plugins = nil self end |
#configure_for_database(database_url) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 |
# File 'lib/hanami/providers/db/adapter.rb', line 41 def configure_for_database(database_url) end |
#configure_from_adapter(other_adapter) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 37 38 |
# File 'lib/hanami/providers/db/adapter.rb', line 34 def configure_from_adapter(other_adapter) return if skip_defaults? plugins.concat(other_adapter.plugins).uniq! unless skip_defaults?(:plugins) end |
#gateway_cache_keys ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
57 58 59 |
# File 'lib/hanami/providers/db/adapter.rb', line 57 def gateway_cache_keys end |
#gateway_options ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
62 63 64 |
# File 'lib/hanami/providers/db/adapter.rb', line 62 def {} end |
#plugin(**plugin_spec, &config_block) ⇒ Object
46 47 48 |
# File 'lib/hanami/providers/db/adapter.rb', line 46 def plugin(**plugin_spec, &config_block) plugins << [plugin_spec, config_block] end |
#plugins ⇒ Object
52 53 54 |
# File 'lib/hanami/providers/db/adapter.rb', line 52 def plugins config.plugins ||= [] end |
#skip_defaults(setting_name = nil) ⇒ Object
24 25 26 |
# File 'lib/hanami/providers/db/adapter.rb', line 24 def skip_defaults(setting_name = nil) @skip_defaults[setting_name] = true end |