Module: Hanami::Action

Defined in:
lib/hanami/action.rb,
lib/hanami/action/glue.rb,
lib/hanami/action/head.rb,
lib/hanami/action/mime.rb,
lib/hanami/action/rack.rb,
lib/hanami/action/cache.rb,
lib/hanami/action/flash.rb,
lib/hanami/action/params.rb,
lib/hanami/action/cookies.rb,
lib/hanami/action/request.rb,
lib/hanami/action/session.rb,
lib/hanami/action/callable.rb,
lib/hanami/action/redirect.rb,
lib/hanami/action/callbacks.rb,
lib/hanami/action/exposable.rb,
lib/hanami/action/rack/file.rb,
lib/hanami/action/throwable.rb,
lib/hanami/action/cookie_jar.rb,
lib/hanami/action/base_params.rb,
lib/hanami/action/rack/errors.rb,
lib/hanami/action/validatable.rb,
lib/hanami/action/configurable.rb,
lib/hanami/action/cache/expires.rb,
lib/hanami/action/rack/callable.rb,
lib/hanami/action/exposable/guard.rb,
lib/hanami/action/cache/directives.rb,
lib/hanami/action/cache/cache_control.rb,
lib/hanami/action/cache/conditional_get.rb

Overview

An HTTP endpoint

Examples:

require 'hanami/controller'

class Show
  include Hanami::Action

  def call(params)
    # ...
  end
end

Since:

  • 0.1.0

Defined Under Namespace

Modules: Cache, Callable, Callbacks, Configurable, Cookies, Exposable, Glue, Head, Mime, Rack, Redirect, Session, Throwable, Validatable Classes: BaseParams, CookieJar, Flash, Params, Request

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 basic Hanami::Action modules to the given class.


52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/hanami/action.rb', line 52

def self.included(base)
  base.class_eval do
    include Rack
    include Mime
    include Redirect
    include Exposable
    include Throwable
    include Callbacks
    include Validatable if defined?(Validatable)
    include Configurable
    include Head
    prepend Callable
  end
end