Class: RuboCop::AST::NodePattern::Compiler::NodePatternSubcompiler
- Inherits:
-
Subcompiler
- Object
- Subcompiler
- RuboCop::AST::NodePattern::Compiler::NodePatternSubcompiler
- Defined in:
- lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb
Overview
Compiles code that evalues to true or false for a given value ‘var` (typically a RuboCop::AST::Node) or it’s ‘node.type` if `seq_head` is true
Doc on how this fits in the compiling process:
/docs/modules/ROOT/pages/node_pattern.adoc
Direct Known Subclasses
Instance Attribute Summary collapse
-
#access ⇒ Object
readonly
Returns the value of attribute access.
-
#seq_head ⇒ Object
readonly
Returns the value of attribute seq_head.
Attributes inherited from Subcompiler
Instance Method Summary collapse
-
#initialize(compiler, var: nil, access: var, seq_head: false) ⇒ NodePatternSubcompiler
constructor
A new instance of NodePatternSubcompiler.
Methods inherited from Subcompiler
#compile, inherited, method_added
Constructor Details
#initialize(compiler, var: nil, access: var, seq_head: false) ⇒ NodePatternSubcompiler
Returns a new instance of NodePatternSubcompiler.
16 17 18 19 20 21 |
# File 'lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb', line 16 def initialize(compiler, var: nil, access: var, seq_head: false) super(compiler) @var = var @access = access @seq_head = seq_head end |
Instance Attribute Details
#access ⇒ Object (readonly)
Returns the value of attribute access.
14 15 16 |
# File 'lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb', line 14 def access @access end |
#seq_head ⇒ Object (readonly)
Returns the value of attribute seq_head.
14 15 16 |
# File 'lib/rubocop/ast/node_pattern/compiler/node_pattern_subcompiler.rb', line 14 def seq_head @seq_head end |