Class: Querly::Pattern::Expr::ReceiverContext
- Defined in:
- lib/querly/pattern/expr.rb
Instance Attribute Summary collapse
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Instance Method Summary collapse
-
#initialize(receiver:) ⇒ ReceiverContext
constructor
A new instance of ReceiverContext.
- #test_node(node) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(receiver:) ⇒ ReceiverContext
Returns a new instance of ReceiverContext.
286 287 288 |
# File 'lib/querly/pattern/expr.rb', line 286 def initialize(receiver:) @receiver = receiver end |
Instance Attribute Details
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
284 285 286 |
# File 'lib/querly/pattern/expr.rb', line 284 def receiver @receiver end |
Instance Method Details
#test_node(node) ⇒ Object
290 291 292 293 294 295 296 297 |
# File 'lib/querly/pattern/expr.rb', line 290 def test_node(node) if receiver.test_node(node) true else type = node&.type (type == :send || type == :csend) && test_node(node.children[0]) end end |