Module: Bureau

Defined in:
lib/bureau.rb,
lib/bureau/adapter.rb

Defined Under Namespace

Modules: Adapter, ClassMethods, InstanceMethods

Constant Summary collapse

F =
::File
DIR =
F.expand_path(F.dirname(__FILE__))
BEFORE =
Proc.new{
  if @r.fullpath.sub(/\/$/, '')==_config[:path]&&_config[:index]
    @action, *@action_arguments = _config[:index]
  end
  if @r['_no_wrap']
    @action = "wrap_api_response"
    @api_arguments = @action_arguments
    @action_arguments = []
    if @r['_destination'].nil?
      dest = "&_destination=#{::Rack::Utils::escape(@r.fullpath)}"
      @r.env.update({'QUERY_STRING'=>@r.env['QUERY_STRING']+dest})
    end
  end
}

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/bureau.rb', line 21

def self.included(klass)
  klass.class_eval do
    extend ClassMethods
    include InstanceMethods
    include Rack::Golem
  end
  klass.before(&BEFORE)
end