Class: Avm::Data::Unit
- Inherits:
-
Object
- Object
- Avm::Data::Unit
- Includes:
- Callbacks
- Defined in:
- lib/avm/data/unit.rb
Direct Known Subclasses
Instance Method Summary collapse
- #dump(data_path) ⇒ Object
- #dump_to_directory(directory, identifier) ⇒ Object
- #extension ⇒ Object
- #installation_files_data ⇒ Struct(:key, :subpath)?
- #load(data_path) ⇒ Object
- #load_from_directory(directory, identifier) ⇒ Object
- #name ⇒ Object
Instance Method Details
#dump(data_path) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/avm/data/unit.rb', line 42 def dump(data_path) run_callbacks :dump do infom "Dumping unit \"#{name}\" to \"#{data_path}\"..." do_dump(data_path) end end |
#dump_to_directory(directory, identifier) ⇒ Object
38 39 40 |
# File 'lib/avm/data/unit.rb', line 38 def dump_to_directory(directory, identifier) dump(unit_on_directory_path(directory, identifier)) end |
#extension ⇒ Object
24 25 26 27 28 |
# File 'lib/avm/data/unit.rb', line 24 def extension singleton_class.const_get('EXTENSION') rescue NameError '' end |
#installation_files_data ⇒ Struct(:key, :subpath)?
50 51 52 |
# File 'lib/avm/data/unit.rb', line 50 def installation_files_data nil end |
#load(data_path) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/avm/data/unit.rb', line 54 def load(data_path) run_callbacks :load do infom "Loading unit \"#{name}\" from \"#{data_path}\"..." do_load(data_path) end end |
#load_from_directory(directory, identifier) ⇒ Object
34 35 36 |
# File 'lib/avm/data/unit.rb', line 34 def load_from_directory(directory, identifier) load(unit_on_directory_path(directory, identifier)) end |
#name ⇒ Object
30 31 32 |
# File 'lib/avm/data/unit.rb', line 30 def name self.class end |