Parent

Methods

Files

Class/Module Index [+]

Quicksearch

Dragonfly::RoutedEndpoint

Public Class Methods

new(app, &block) click to toggle source
# File lib/dragonfly/routed_endpoint.rb, line 6
def initialize(app, &block)
  @app = app
  @block = block
end

Public Instance Methods

call(env) click to toggle source
# File lib/dragonfly/routed_endpoint.rb, line 11
def call(env)
  params = Utils.symbolize_keys Rack::Request.new(env).params
  job = @block.call(params.merge(routing_params(env)), @app)
  Response.new(job, env).to_response
rescue Job::NoSHAGiven => e
  [400, {"Content-Type" => 'text/plain'}, ["You need to give a SHA parameter"]]
rescue Job::IncorrectSHA => e
  [400, {"Content-Type" => 'text/plain'}, ["The SHA parameter you gave (#{e}) is incorrect"]]
end
inspect() click to toggle source
# File lib/dragonfly/routed_endpoint.rb, line 21
def inspect
  "<#{self.class.name} for app #{@app.name.inspect} >"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.