Class: Hanami::Config::Router Private

Inherits:
Object
  • Object
show all
Includes:
Dry::Configurable
Defined in:
lib/hanami/config/router.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 router config

Since:

  • 2.0.0

Instance Method Summary collapse

Constructor Details

#initialize(base_config) ⇒ Router

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 Router.

Since:

  • 2.0.0



20
21
22
# File 'lib/hanami/config/router.rb', line 20

def initialize(base_config)
  @base_config = base_config
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



34
35
36
37
38
39
40
# File 'lib/hanami/config/router.rb', line 34

def method_missing(name, *args, &block)
  if config.respond_to?(name)
    config.public_send(name, *args, &block)
  else
    super
  end
end

Instance Method Details

#optionsObject

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



28
29
30
# File 'lib/hanami/config/router.rb', line 28

def options
  {base_url: base_config.base_url}
end