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