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

Returns:

  • (Types::Strict::Integer)


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

#matcherMatcher

Returns:



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

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.

Parameters:

  • other (<>)


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

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.

Parameters:

  • other (<>)

Returns:

  • (Boolean)


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

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.



29
30
31
# File 'lib/fear/extractor/array_head_matcher.rb', line 29

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