Sha256: 04d037337b54cd109a2868c5742a3df4019b24169fea5181cc5efe18ccf88f8a
Contents?: true
Size: 1.02 KB
Versions: 74
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true require 'avm/data/callbacks' require 'eac_ruby_utils/core_ext' module Avm module Data class Unit acts_as_abstract( do_clear: [], do_dump: [:dump_path], do_load: [:dump_path], dump_path_extension: [] ) enable_speaker include ::Avm::Data::Callbacks # @param dump_path [Pathname] # @return [void] def clear run_callbacks(:dump) { do_clear } end # @param dump_path [Pathname] # @return [void] def dump(dump_path) run_callbacks :dump do infom "Dumping unit \"#{name}\" to \"#{dump_path}\"..." do_dump(dump_path) end end # @param dump_path [Pathname] # @return [void] def load(dump_path) run_callbacks :load do clear infom "Loading unit \"#{name}\" from \"#{dump_path}\"..." do_load(dump_path) end end # @return [String] def name self.class.name end end end end
Version data entries
74 entries across 74 versions & 2 rubygems