Module: Hanami::Action

Defined in:
gems/gems/hanami-1.3.3/lib/hanami/action/csrf_protection.rb,
gems/gems/hanami-1.3.3/lib/hanami/action/routing_helpers.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/glue.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/head.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/mime.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/rack.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/cache.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/flash.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/params.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/cookies.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/request.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/session.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/callable.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/redirect.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/callbacks.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/exposable.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/rack/file.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/throwable.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/cookie_jar.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/base_params.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/validatable.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/configurable.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/cache/expires.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/rack/callable.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/exposable/guard.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/cache/directives.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/cache/cache_control.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action/cache/conditional_get.rb,
gems/gems/hanami-controller-1.3.2/lib/hanami/action.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/glue.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/head.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/mime.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/rack.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/cache.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/flash.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/params.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/cookies.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/request.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/session.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/callable.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/redirect.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/callbacks.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/exposable.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/rack/file.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/throwable.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/cookie_jar.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/base_params.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/rack/errors.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/validatable.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/configurable.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/cache/expires.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/rack/callable.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/exposable/guard.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/cache/directives.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/cache/cache_control.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action/cache/conditional_get.rb,
gems/gems/hanami-controller-1.3.3/lib/hanami/action.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: CSRFProtection, Cache, Callbacks, Configurable, Cookies, Exposable, Head, Mime, Rack, Redirect, Session, Throwable Classes: CookieJar, Params, Request

Instance Method Summary collapse

Instance Method Details

#flashObject (private)

Raise error when Hanami::Action::Session isn’t included.

To use flash, include Hanami::Action::Session.

Raises:

  • (Hanami::Controller::MissingSessionError)

Since:

  • 1.2.0

def flash
  raise Hanami::Controller::MissingSessionError.new(:flash)
end

#sessionObject (private)

Raise error when Hanami::Action::Session isn’t included.

To use session, include Hanami::Action::Session.

Raises:

  • (Hanami::Controller::MissingSessionError)

Since:

  • 1.2.0

def session
  raise Hanami::Controller::MissingSessionError.new(:session)
end