Class: Hanami::Config::Views Private

Inherits:
Object
  • Object
show all
Includes:
Dry::Configurable
Defined in:
lib/hanami/config/views.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Hanami views config

This is NOT RELEASED as of 2.0.0.

Since:

  • 2.0.0

Instance Method Summary collapse

Constructor Details

#initializeViews

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.

Since:

  • 2.0.0



22
23
24
25
26
27
28
# File 'lib/hanami/config/views.rb', line 22

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)

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.

Since:

  • 2.0.0



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/hanami/config/views.rb', line 63

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.

Since:

  • 2.0.0



38
39
40
41
42
43
44
# File 'lib/hanami/config/views.rb', line 38

def finalize!
  return self if frozen?

  base_config.finalize!

  super
end