class NeuronCheckSystem::OrMatcher

OR条件。渡されたマッチャ複数のうち、どれか1つでも条件を満たせばOK

Public Class Methods

new(child_expecteds, declared_caller_locations) click to toggle source
# File lib/neuroncheck/matcher.rb, line 171
def initialize(child_expecteds, declared_caller_locations)
  @child_matchers = child_expecteds.map{|x| NeuronCheckSystem.get_appropriate_matcher(x, declared_caller_locations)}
  @declared_caller_locations = declared_caller_locations
end

Public Instance Methods

expected_caption() click to toggle source
# File lib/neuroncheck/matcher.rb, line 181
def expected_caption
  captions = @child_matchers.map{|x| x.expected_caption}

  Utils.string_join_using_or_conjunction(captions)
end
expected_short_caption() click to toggle source
# File lib/neuroncheck/matcher.rb, line 186
def expected_short_caption
  '[' + @child_matchers.map{|x| x.expected_short_caption}.join(', ') + ']'
end
match?(value, self_object) click to toggle source
# File lib/neuroncheck/matcher.rb, line 176
def match?(value, self_object)
  # どれか1つにマッチすればOK
  @child_matchers.any?{|x| x.match?(value, self_object)}
end
meta_info_as_json() click to toggle source
# File lib/neuroncheck/matcher.rb, line 190
def meta_info_as_json
  super.update('child_matchers' => @child_matchers.map{|x| x.meta_info_as_json})
end