Class: Avm::Data::Unit
- Includes:
- ActiveSupport::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
- #load(data_path) ⇒ Object
- #load_from_directory(directory, identifier) ⇒ Object
- #name ⇒ Object
Instance Method Details
#dump(data_path) ⇒ Object
63 64 65 66 67 68 |
# File 'lib/avm/data/unit.rb', line 63 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
59 60 61 |
# File 'lib/avm/data/unit.rb', line 59 def dump_to_directory(directory, identifier) dump(unit_on_directory_path(directory, identifier)) end |
#extension ⇒ Object
45 46 47 48 49 |
# File 'lib/avm/data/unit.rb', line 45 def extension singleton_class.const_get('EXTENSION') rescue NameError '' end |
#load(data_path) ⇒ Object
70 71 72 73 74 75 |
# File 'lib/avm/data/unit.rb', line 70 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
55 56 57 |
# File 'lib/avm/data/unit.rb', line 55 def load_from_directory(directory, identifier) load(unit_on_directory_path(directory, identifier)) end |
#name ⇒ Object
51 52 53 |
# File 'lib/avm/data/unit.rb', line 51 def name self.class end |