lib/simple/httpd/service_adapter.rb in simple-httpd-0.3.3 vs lib/simple/httpd/service_adapter.rb in simple-httpd-0.3.4
- old
+ new
@@ -70,11 +70,11 @@
service = @service
# define sinatra route.
route(verb, path) do
::Simple::Service.with_context(context) do
- result = ::Simple::Service.invoke2(service, action_name, args: self.parsed_body, flags: self.params)
+ result = ::Simple::Service.invoke(service, action_name, args: self.parsed_body, flags: stringified_params)
encode_result(result)
end
end
end
@@ -89,9 +89,15 @@
result
end
end
module Helpers
+ def stringified_params
+ params.each_with_object({}) do |(k,v), hsh|
+ hsh[k.to_s] = v
+ end
+ end
+
def context
# We return nil here. nil *is* a valid value for Simple::Service.with_context.
# Important is that with_context is being called.
nil
end