Class: Hanami::Config::Assets
- Inherits:
-
Object
- Object
- Hanami::Config::Assets
- Includes:
- Dry::Configurable
- Defined in:
- lib/hanami/config/assets.rb
Overview
Hanami assets config
This exposes all the settings from the standalone ‘Hanami::Assets` class, pre-configured with sensible defaults for actions within a full Hanami app. It also provides additional settings for further integration of assets with other full stack app components.
Instance Attribute Summary collapse
-
#serve ⇒ Hanami::Config::Actions::Cookies
Serve static assets.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Assets
constructor
private
A new instance of Assets.
Constructor Details
#initialize(**options) ⇒ Assets
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 Assets.
43 44 45 46 47 48 49 |
# File 'lib/hanami/config/assets.rb', line 43 def initialize(*, **) super() @base_config = Hanami::Assets::Config.new(**) configure_defaults end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (private)
69 70 71 72 73 74 75 76 77 |
# File 'lib/hanami/config/assets.rb', line 69 def method_missing(name, *args, &block) if config.respond_to?(name) config.public_send(name, *args, &block) elsif base_config.respond_to?(name) base_config.public_send(name, *args, &block) else super end end |
Instance Attribute Details
#serve ⇒ Hanami::Config::Actions::Cookies
Serve static assets.
When this is ‘true`, the app will serve static assets.
If not set, this will:
* Check if the `HANAMI_SERVE_ASSETS` environment variable is set to `"true"`.
* If not, it will check if the app is running in the `development` or `test` environment.
36 |
# File 'lib/hanami/config/assets.rb', line 36 setting :serve |