Class: Gloo::Verbs::Unload

Inherits:
Core::Verb show all
Defined in:
lib/gloo/verbs/unload.rb

Constant Summary collapse

KEYWORD =
'unload'.freeze
KEYWORD_SHORT =
'u!'.freeze

Constants inherited from Core::Baseo

Core::Baseo::NOT_IMPLEMENTED_ERR

Instance Attribute Summary

Attributes inherited from Core::Verb

#params, #tokens

Attributes inherited from Core::Baseo

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Core::Verb

#display_value, help, inherited, #initialize, #type_display

Methods inherited from Core::Baseo

#initialize, #type_display

Constructor Details

This class inherits a constructor from Gloo::Core::Verb

Class Method Details

.doc_dataObject

Get the verb's documentation data.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/gloo/verbs/unload.rb', line 51

def self.doc_data
  {
    :name => KEYWORD,
    :shortcut => KEYWORD_SHORT,
    :description => 'Un-load all open files. Use the files ' \
      'command to see the list of files that will be un-loaded. ' \
      'The heap will be empty after this is run, so be sure to ' \
      'save state prior to executing.',
    :syntax => [ 'unload' ],
    :result => 'All objects will be unloaded from the heap.',
    :examples => <<~EXAMPLES.strip
      > unload
    EXAMPLES
  }
end

.keywordObject

Get the Verb's keyword.



27
28
29
# File 'lib/gloo/verbs/unload.rb', line 27

def self.keyword
  return KEYWORD
end

.keyword_shortcutObject

Get the Verb's keyword shortcut.



34
35
36
# File 'lib/gloo/verbs/unload.rb', line 34

def self.keyword_shortcut
  return KEYWORD_SHORT
end

Instance Method Details

#runObject

Run the verb. This will unload all loaded objects and reset the engine state.



18
19
20
21
22
# File 'lib/gloo/verbs/unload.rb', line 18

def run
  return unless @engine.persist_man.maps
  
  @engine.persist_man.unload_all
end