Class: Avm::Instances::Data::Unit

Inherits:
Data::UnitWithCommands show all
Defined in:
lib/avm/instances/data/unit.rb

Direct Known Subclasses

FilesUnit

Instance Method Summary collapse

Methods inherited from Data::UnitWithCommands

#dump_path_extension, #dump_to_directory, #installation_files_data, #load_from_directory

Methods inherited from Data::Unit

#clear, #dump, #name

Instance Method Details

#data_default_dump_pathPathname

Returns:

  • (Pathname)


13
14
15
16
17
# File 'lib/avm/instances/data/unit.rb', line 13

def data_default_dump_path
  instance.data_default_dump_path.to_pathname.basename_sub('.*') do |b|
    "#{b}_#{identifier}#{dump_path_extension}"
  end
end

#identifierString

Returns:

  • (String)


20
21
22
# File 'lib/avm/instances/data/unit.rb', line 20

def identifier
  instance.data_package.units.key(self) || raise("No identifier found for #{self}")
end

#loadObject



24
25
26
# File 'lib/avm/instances/data/unit.rb', line 24

def load(...)
  instance.on_disabled_processes { super }
end