Class: Yast::HooksClass
- Inherits:
-
Module
- Object
- Module
- Yast::HooksClass
- Defined in:
- ../../library/general/src/modules/Hooks.rb
Defined Under Namespace
Classes: Hook, HookFile, SearchPath
Instance Attribute Summary (collapse)
-
- (Object) last
readonly
Returns the value of attribute last.
-
- (Object) search_path
readonly
Returns the value of attribute search_path.
Instance Method Summary (collapse)
- - (Object) all
- - (Boolean) exists?(hook_name)
- - (Object) find(hook_name)
-
- (HooksClass) initialize
constructor
A new instance of HooksClass.
- - (Object) run(hook_name)
Constructor Details
- (HooksClass) initialize
Returns a new instance of HooksClass
66 67 68 69 70 |
# File '../../library/general/src/modules/Hooks.rb', line 66 def initialize textdomain 'base' @hooks = {} @search_path = SearchPath.new end |
Instance Attribute Details
- (Object) last (readonly)
Returns the value of attribute last
62 63 64 |
# File '../../library/general/src/modules/Hooks.rb', line 62 def last @last end |
- (Object) search_path (readonly)
Returns the value of attribute search_path
62 63 64 |
# File '../../library/general/src/modules/Hooks.rb', line 62 def search_path @search_path end |
Instance Method Details
- (Object) all
85 86 87 |
# File '../../library/general/src/modules/Hooks.rb', line 85 def all hooks.values end |
- (Boolean) exists?(hook_name)
89 90 91 |
# File '../../library/general/src/modules/Hooks.rb', line 89 def exists? hook_name !!find(hook_name) end |
- (Object) find(hook_name)
81 82 83 |
# File '../../library/general/src/modules/Hooks.rb', line 81 def find hook_name hooks[hook_name] end |
- (Object) run(hook_name)
72 73 74 75 76 77 78 79 |
# File '../../library/general/src/modules/Hooks.rb', line 72 def run hook_name hook_name = hook_name.to_s raise "Hook name not specified" if hook_name.empty? hook = create(hook_name, caller.first) hook.execute @last = hook end |