Class: Querly::Pattern::Kind::Discarded
- Includes:
- Negatable
- Defined in:
- lib/querly/pattern/kind.rb
Instance Attribute Summary
Attributes included from Negatable
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Negatable
Methods inherited from Base
Instance Method Details
#discarded?(pair) ⇒ Boolean
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/querly/pattern/kind.rb', line 60 def discarded?(pair) node = pair.node parent = pair.parent&.node case parent&.type when :begin if node.equal? parent.children.last discarded? pair.parent else true end else false end end |
#test_kind(pair) ⇒ Object
56 57 58 |
# File 'lib/querly/pattern/kind.rb', line 56 def test_kind(pair) !negated == !!discarded?(pair) end |