Class: Fear::Extractor::ArrayHeadMatcher Private

Inherits:
Matcher
  • Object
show all
Defined in:
lib/fear/extractor/array_head_matcher.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Part of recursive array matcher. Match against its head.

See Also:

Constant Summary

Constants inherited from Matcher

Matcher::EMPTY_ARRAY, Matcher::EMPTY_HASH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Matcher

#and, #call, #call_or_else, #initialize

Constructor Details

This class inherits a constructor from Fear::Extractor::Matcher

Instance Attribute Details

#indexTypes::Strict::Integer


# File 'lib/fear/extractor/array_head_matcher.rb', line 8


#matcherMatcher


# File 'lib/fear/extractor/array_head_matcher.rb', line 8


Instance Method Details

#bindings(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


23
24
25
26
27
28
29
# File 'lib/fear/extractor/array_head_matcher.rb', line 23

def bindings(other)
  if other.empty?
    super
  else
    matcher.bindings(other.first)
  end
end

#defined_at?(other) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


14
15
16
17
18
19
20
# File 'lib/fear/extractor/array_head_matcher.rb', line 14

def defined_at?(other)
  if other.empty?
    false
  else
    matcher.defined_at?(other.first)
  end
end

#failure_reason(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


31
32
33
# File 'lib/fear/extractor/array_head_matcher.rb', line 31

def failure_reason(other)
  matcher.failure_reason(other.first)
end