Class: Fakes::Matches
- Inherits:
-
Object
- Object
- Fakes::Matches
- Defined in:
- lib/core/arg_matching/matches.rb
Class Method Summary collapse
- .any ⇒ Object
- .condition(&conditional_block) ⇒ Object
- .greater_than(value) ⇒ Object
- .in_range(range) ⇒ Object
- .nil ⇒ Object
- .not_nil ⇒ Object
- .regex(regex) ⇒ Object
Class Method Details
.any ⇒ Object
12 13 14 |
# File 'lib/core/arg_matching/matches.rb', line 12 def any condition{|ignored| true} end |
.condition(&conditional_block) ⇒ Object
29 30 31 |
# File 'lib/core/arg_matching/matches.rb', line 29 def condition(&conditional_block) return BlockArgMatcher.new(conditional_block) end |
.greater_than(value) ⇒ Object
16 17 18 |
# File 'lib/core/arg_matching/matches.rb', line 16 def greater_than(value) condition{|number| number > value} end |
.in_range(range) ⇒ Object
21 22 23 |
# File 'lib/core/arg_matching/matches.rb', line 21 def in_range(range) condition{|item| range === item} end |
.nil ⇒ Object
8 9 10 |
# File 'lib/core/arg_matching/matches.rb', line 8 def nil condition{|item| item == nil} end |
.not_nil ⇒ Object
4 5 6 |
# File 'lib/core/arg_matching/matches.rb', line 4 def not_nil condition{|item| item != nil} end |
.regex(regex) ⇒ Object
25 26 27 |
# File 'lib/core/arg_matching/matches.rb', line 25 def regex(regex) condition{|string| regex =~ string} end |