Class: Ast::Crispr::Delete

Inherits:
Actor
  • Object
show all
Includes:
OperationProfilable, OperationSupport
Defined in:
lib/ast/crispr.rb

Instance Method Summary collapse

Methods included from OperationProfilable

included, #operation_profile

Instance Method Details

#callObject



1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
# File 'lib/ast/crispr.rb', line 1403

def call
  self.operation_profile = self.class.operation_profile
  actor = Replace.result(
    content: content,
    target: target,
    replacement: '',
    source_label: source_label
  )
  fail!(error: actor.error, details: actor.details) if actor.failure?

  self.updated_content = actor.updated_content
  self.matches = actor.matches
  self.match_count = actor.match_count
  self.changed = actor.changed
  self.captured_text = actor.captured_text
end