Class: Fakes::Matches

Inherits:
Object
  • Object
show all
Defined in:
lib/core/arg_matching/matches.rb

Class Method Summary collapse

Class Method Details

.anyObject



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

.nilObject



8
9
10
# File 'lib/core/arg_matching/matches.rb', line 8

def nil
  condition{|item| item == nil}
end

.not_nilObject



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