summaryrefslogtreecommitdiff
path: root/lib/infrastructure/mixins/specification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/infrastructure/mixins/specification.rb')
-rw-r--r--lib/infrastructure/mixins/specification.rb23
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/infrastructure/mixins/specification.rb b/lib/infrastructure/mixins/specification.rb
deleted file mode 100644
index 38abebb..0000000
--- a/lib/infrastructure/mixins/specification.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-module Booty
- module Specification
- def or(other_predicate = nil, &block)
- matcher = create_predicate(other_predicate, &block)
- create_predicate { |item| self.matches?(item) || matcher.matches?(item) }
- end
-
- def and(other_predicate = nil, &block)
- matcher = create_predicate(other_predicate, &block)
- create_predicate { |item| self.matches?(item) && matcher.matches?(item) }
- end
-
- def not
- create_predicate { |item| !self.matches?(item) }
- end
-
- private
-
- def create_predicate(predicate = nil, &block)
- block_given? ? Booty::BlockSpecification.new(&block) : predicate
- end
- end
-end