Skip to content

Commit

Permalink
fixing interceptor calls chain with current number of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Dec 29, 2010
1 parent 9676d98 commit 394a1b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/restfulie/client/dsl.rb
Expand Up @@ -42,6 +42,7 @@ def method_missing(sym, *args)
end

def request_flow(env = {})
Restfulie::Common::Logger.logger.debug "ready to execute request using stack #{@requests}"
Parser.new(@requests).continue(self, env)
end

Expand All @@ -58,7 +59,11 @@ def continue(request, env)
if current.nil?
return nil
end
filter = current[:type].new(current[:args])
if current[:type].instance_method(:initialize).arity==1
filter = current[:type].new(current[:args])
else
filter = current[:type].new
end
Restfulie::Common::Logger.logger.debug "invoking filter #{filter.class.name} with #{request} at #{env}"
filter.execute(self.dup, request, env)
end
Expand Down
2 changes: 2 additions & 0 deletions lib/restfulie/client/feature/serialize_body.rb
@@ -1,3 +1,5 @@
# Feature responsible for marshalling the entity into the request body.
# It will use the request content type header to select the proper marshaller using Medie.
class Restfulie::Client::Feature::SerializeBody

def execute(flow, request, env = {})
Expand Down

0 comments on commit 394a1b4

Please sign in to comment.