Added support for Ruby v2 Specialization (#1101)

* Added support for Ruby v2 Specialization
* Added ruby v2 example with builder code
This commit is contained in:
Brendan Stennett
2019-03-13 22:55:26 +08:00
committed by Ta-Ching Chen
parent f104f0b46b
commit c717f182b6
12 changed files with 153 additions and 19 deletions
+3 -3
View File
@@ -7,10 +7,10 @@ module Fission
def self.call(env)
context = Context.new(env)
response = if method(:handler).arity > 0
handler(context)
response = if $handler.arity > 0
$handler.call(context)
else
handler
$handler.call
end
response.is_a?(Array) ? response : Rack::Response.new([response]).finish