insertPlaybookRegistration function

String? insertPlaybookRegistration(
  1. String file, {
  2. required String name,
  3. required String className,
})

Adds '<name>': <className>.new, to the playbooks map in file.

Returns the updated file, or null when the playbook is already registered or the playbooks map can't be found.

Implementation

String? insertPlaybookRegistration(
  String file, {
  required String name,
  required String className,
}) => insertRegistryEntry(
  file,
  variable: 'playbooks',
  type: 'Playbook Function()',
  key: name,
  value: '$className.new',
);