Class: Evilution::Mutator::Operator::BeginUnwrap
- Defined in:
- lib/evilution/mutator/operator/begin_unwrap.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#call, clear_parse_cache!, #initialize, operator_name, parsed_tree_for
Constructor Details
This class inherits a constructor from Evilution::Mutator::Base
Instance Method Details
#visit_begin_node(node) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/evilution/mutator/operator/begin_unwrap.rb', line 6 def visit_begin_node(node) return super if node.rescue_clause || node.else_clause || node.ensure_clause return super if node.statements.nil? return super if node.begin_keyword_loc.nil? body_text = @file_source.byteslice(node.statements.location.start_offset, node.statements.location.length) add_mutation( offset: node.location.start_offset, length: node.location.length, replacement: body_text, node: node ) super end |