Class: Avm::Data::Unit

Inherits:
Object
  • Object
show all
Includes:
Callbacks
Defined in:
lib/avm/data/unit.rb

Direct Known Subclasses

UnitWithCommands

Instance Method Summary collapse

Instance Method Details

#clearvoid

This method returns an undefined value.

Parameters:

  • dump_path (Pathname)


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

def clear
  run_callbacks(:dump) { do_clear }
end

#dump(dump_path) ⇒ void

This method returns an undefined value.

Parameters:

  • dump_path (Pathname)


26
27
28
29
30
31
# File 'lib/avm/data/unit.rb', line 26

def dump(dump_path)
  run_callbacks :dump do
    infom "Dumping unit \"#{name}\" to \"#{dump_path}\"..."
    do_dump(dump_path)
  end
end

#load(dump_path) ⇒ void

This method returns an undefined value.

Parameters:

  • dump_path (Pathname)


35
36
37
38
39
40
41
# File 'lib/avm/data/unit.rb', line 35

def load(dump_path)
  run_callbacks :load do
    clear
    infom "Loading unit \"#{name}\" from \"#{dump_path}\"..."
    do_load(dump_path)
  end
end

#nameString

Returns:

  • (String)


44
45
46
# File 'lib/avm/data/unit.rb', line 44

def name
  self.class.name
end