include path parameters in params hash for ruby environment (#249)

* include path parameters in params hash for ruby environment

* Improve code organization and documentation for ruby environment.

* Document Ruby examples
This commit is contained in:
S. Brent Faulkner
2017-07-04 23:44:18 -07:00
committed by Soam Vasani
parent ae87c0ea37
commit 0fd60eab3b
7 changed files with 208 additions and 52 deletions
+19
View File
@@ -0,0 +1,19 @@
# frozen_string_literal: true
require_relative 'context'
module Fission
module Handler
def self.call(env)
response = if method(:handler).arity > 0
handler(Context.new(env))
else
handler
end
response.is_a?(Array) ? response : Rack::Response.new([response]).finish
rescue
Rack::Response.new(['500 Internal Server Error'], 500, {}).finish
end
end
end