Class: Evilution::AST::Pattern::ValueMatcher Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/ast/pattern/matcher.rb

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.

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ValueMatcher

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.

Returns a new instance of ValueMatcher.



56
57
58
# File 'lib/evilution/ast/pattern/matcher.rb', line 56

def initialize(value)
  @value = value
end

Instance Method Details

#match?(node) ⇒ 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.

Returns:

  • (Boolean)


64
65
66
# File 'lib/evilution/ast/pattern/matcher.rb', line 64

def match?(node)
  match_value?(node)
end

#match_value?(actual) ⇒ 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.

Returns:

  • (Boolean)


60
61
62
# File 'lib/evilution/ast/pattern/matcher.rb', line 60

def match_value?(actual)
  actual.to_s == @value
end