Module: Izzy
- Defined in:
- lib/izzy.rb,
lib/izzy/version.rb
Constant Summary collapse
- VERSION =
'3.2.0'
Instance Method Summary collapse
-
#all_of?(*methods) ⇒ Boolean
Boolean Predicate.
- #any_of?(*methods) ⇒ Boolean
- #find_where(matchers = {}) ⇒ Object
-
#matches_all?(matchers = {}) ⇒ Boolean
Matchers.
- #matches_any?(matchers = {}) ⇒ Boolean
- #matches_none?(matchers = {}) ⇒ Boolean
- #none_of?(*methods) ⇒ Boolean
- #reject_where(matchers = {}) ⇒ Object
-
#select_where(matchers = {}) ⇒ Object
Enumerable Matchers.
Instance Method Details
#all_of?(*methods) ⇒ Boolean
Boolean Predicate
7 8 9 |
# File 'lib/izzy.rb', line 7 def all_of?(*methods) methods.all? &method_check end |
#any_of?(*methods) ⇒ Boolean
11 12 13 |
# File 'lib/izzy.rb', line 11 def any_of?(*methods) methods.any? &method_check end |
#find_where(matchers = {}) ⇒ Object
43 44 45 |
# File 'lib/izzy.rb', line 43 def find_where(matchers = {}) self.find { |s| s.matches_all? matchers } end |
#matches_all?(matchers = {}) ⇒ Boolean
Matchers
21 22 23 |
# File 'lib/izzy.rb', line 21 def matches_all?(matchers = {}) matchers.all? &matcher_check(:all?) end |
#matches_any?(matchers = {}) ⇒ Boolean
25 26 27 |
# File 'lib/izzy.rb', line 25 def matches_any?(matchers = {}) matchers.any? &matcher_check(:any?) end |
#matches_none?(matchers = {}) ⇒ Boolean
29 30 31 |
# File 'lib/izzy.rb', line 29 def matches_none?(matchers = {}) matchers.none? &matcher_check(:any?) end |
#none_of?(*methods) ⇒ Boolean
15 16 17 |
# File 'lib/izzy.rb', line 15 def none_of?(*methods) methods.none? &method_check end |
#reject_where(matchers = {}) ⇒ Object
39 40 41 |
# File 'lib/izzy.rb', line 39 def reject_where(matchers = {}) self.reject { |s| s.matches_all? matchers } end |
#select_where(matchers = {}) ⇒ Object
Enumerable Matchers
35 36 37 |
# File 'lib/izzy.rb', line 35 def select_where(matchers = {}) self.select { |s| s.matches_all? matchers } end |