This commit is contained in:
r888888888
2014-04-25 17:15:09 -07:00
parent ceddf792f1
commit 9e2c664a41
10 changed files with 56 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ module Iqdb
module Responses
class Collection
attr_reader :responses
delegate :each, :empty?, :any?, :to => :matches
def initialize(response_string)
@responses = response_string.split(/\n/).map do |string|
@@ -13,10 +14,6 @@ module Iqdb
@matches ||= responses.select {|x| x.is_a?(Iqdb::Responses::Response_200) && x.score >= 90}
end
def empty?
matches.empty?
end
def errored?
errors.any?
end