summaryrefslogtreecommitdiff
path: root/lib/library.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/library.rb')
-rw-r--r--lib/library.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/library.rb b/lib/library.rb
index 4f1321a..f3765b5 100644
--- a/lib/library.rb
+++ b/lib/library.rb
@@ -8,4 +8,7 @@ class Library
def contains(title)
@books.find { |book| book.is_titled?(title) } != nil
end
+ def find_all_matching(criteria)
+ @books.find_all {|book| criteria.is_satisfied_by book }
+ end
end