Class: Hanami::Config::Views
- Inherits:
-
Object
- Object
- Hanami::Config::Views
- Includes:
- Dry::Configurable
- Defined in:
- lib/hanami/config/views.rb
Overview
Hanami views config
This exposes all the settings from the standalone ‘Hanami::View` class, pre-configured with sensible defaults for actions within a full Hanami app. It also provides additional settings for further integration of views with other full stack app components.
Instance Method Summary collapse
- #finalize! ⇒ Object private
-
#initialize ⇒ Views
constructor
private
A new instance of Views.
Constructor Details
#initialize ⇒ Views
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 Views.
26 27 28 29 30 31 32 |
# File 'lib/hanami/config/views.rb', line 26 def initialize(*) super @base_config = Hanami::View.config.dup configure_defaults end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (private)
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/hanami/config/views.rb', line 67 def method_missing(name, *args, &block) return super if NON_FORWARDABLE_METHODS.include?(name) 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 Method Details
#finalize! ⇒ 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.
44 45 46 47 48 49 50 |
# File 'lib/hanami/config/views.rb', line 44 def finalize! return self if frozen? base_config.finalize! super end |