Module: Hanami::API::DSL::ClassMethods Private

Defined in:
lib/hanami/api/dsl.rb

Overview

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

Since:

  • 0.2.0

Defined Under Namespace

Modules: Routes

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#routerObject (readonly)

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:

  • 0.2.0



52
53
54
# File 'lib/hanami/api/dsl.rb', line 52

def router
  @router
end

Class Method Details

.extended(app) ⇒ 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:

  • 0.2.0



56
57
58
59
60
61
62
63
64
65
# File 'lib/hanami/api/dsl.rb', line 56

def self.extended(app)
  super

  app.class_eval do
    klass = Block::Context.dup
    app.const_set(:BlockContext, klass)

    @router = Router.new(block_context: klass)
  end
end