Module: Lotus::Action

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

Overview

An HTTP endpoint

Examples:

require 'lotus/controller'

class Show
  include Lotus::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: CookieJar, Flash, Params, Request

Class Method Summary collapse

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


48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/lotus/action.rb', line 48

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

Instance Method Details

#errorsObject

Expose validation errors

Since:

  • 0.3.0


124
125
126
# File 'lib/lotus/action/validatable.rb', line 124

def errors
  params.errors
end