lib/parliament/response.rb in parliament-ruby-0.2.0 vs lib/parliament/response.rb in parliament-ruby-0.2.1

- old
+ new

@@ -19,11 +19,20 @@ type_index = types.index(node.type) filtered_objects[type_index] << node unless type_index.nil? end end + result = build_responses(filtered_objects) + + types.size == 1 ? result.first : result + end + + def build_responses(filtered_objects) + result = [] + filtered_objects.each do |objects| - Parliament::Response.new(objects) + result << Parliament::Response.new(objects) end + result end end end