Class: Querly::Pattern::Expr::Ivar
- Defined in:
- lib/querly/pattern/expr.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:) ⇒ Ivar
constructor
A new instance of Ivar.
- #test_node(node) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(name:) ⇒ Ivar
Returns a new instance of Ivar.
347 348 349 |
# File 'lib/querly/pattern/expr.rb', line 347 def initialize(name:) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
345 346 347 |
# File 'lib/querly/pattern/expr.rb', line 345 def name @name end |
Instance Method Details
#test_node(node) ⇒ Object
351 352 353 354 355 |
# File 'lib/querly/pattern/expr.rb', line 351 def test_node(node) if node&.type == :ivar name.nil? || node.children.first == name end end |