Class: Ast::Crispr::Insert

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



1495
1496
1497
1498
1499
1500
1501
1502
# File 'lib/ast/crispr.rb', line 1495

def call
  self.operation_profile = self.class.operation_profile
  self.updated_content, self.destination_profile =
    insert_text(content, text, destination: destination, if_missing: if_missing, source_label: source_label)
  self.changed = updated_content != content
rescue Error => e
  crispr_fail!(e)
end