Class: Evilution::AST::Pattern::ValueMatcher
- Inherits:
-
Object
- Object
- Evilution::AST::Pattern::ValueMatcher
- Defined in:
- lib/evilution/ast/pattern/matcher.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ ValueMatcher
constructor
A new instance of ValueMatcher.
- #match?(node) ⇒ Boolean
- #match_value?(actual) ⇒ Boolean
Constructor Details
#initialize(value) ⇒ ValueMatcher
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
64 65 66 |
# File 'lib/evilution/ast/pattern/matcher.rb', line 64 def match?(node) match_value?(node) end |
#match_value?(actual) ⇒ Boolean
60 61 62 |
# File 'lib/evilution/ast/pattern/matcher.rb', line 60 def match_value?(actual) actual.to_s == @value end |