Module: Hanami::Action::Configurable

Defined in:
lib/hanami/action/configurable.rb

Overview

Configuration API

See Also:

Since:

  • 0.2.0

Class Method Summary collapse

Class Method Details

.included(base) ⇒ 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.

Override Ruby's hook for modules. It includes configuration logic

Examples:

require 'hanami/controller'

class Show
  include Hanami::Action
end

Show.configuration

Parameters:

  • base (Class)

    the target action

See Also:

Since:

  • 0.2.0


29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/hanami/action/configurable.rb', line 29

def self.included(base)
  config = Hanami::Controller::Configuration.for(base)

  base.class_eval do
    include Utils::ClassAttribute

    class_attribute :configuration
    self.configuration = config
  end

  config.copy!(base)
end