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.
289 290 291 |
# File 'lib/querly/pattern/expr.rb', line 289 def initialize(name:) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
287 288 289 |
# File 'lib/querly/pattern/expr.rb', line 287 def name @name end |
Instance Method Details
#test_node(node) ⇒ Object
293 294 295 296 297 |
# File 'lib/querly/pattern/expr.rb', line 293 def test_node(node) if node&.type == :ivar name.nil? || node.children.first == name end end |