lib/resourcelogic/response_collector.rb in resourcelogic-0.0.12 vs lib/resourcelogic/response_collector.rb in resourcelogic-0.9.0
- old
+ new
@@ -8,16 +8,11 @@
def initialize
@responses = []
end
def method_missing(method_name, &block)
- existing = self[method_name]
- if existing
- existing[0] = method_name
- existing[1] = block || nil
- else
- @responses << [method_name, block || nil]
- end
+ @responses.delete self[method_name]
+ @responses << [method_name, block || nil]
end
def [](symbol)
@responses.find { |method, block| method == symbol }
end
\ No newline at end of file