Class: Yast::HooksClass
- Inherits:
-
Module
- Object
- Module
- Yast::HooksClass
- Includes:
- Logger
- 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
68 69 70 71 72 |
# File '../../library/general/src/modules/Hooks.rb', line 68 def initialize textdomain "base" @hooks = {} @search_path = SearchPath.new end |
Instance Attribute Details
- (Object) last (readonly)
Returns the value of attribute last
64 65 66 |
# File '../../library/general/src/modules/Hooks.rb', line 64 def last @last end |
- (Object) search_path (readonly)
Returns the value of attribute search_path
64 65 66 |
# File '../../library/general/src/modules/Hooks.rb', line 64 def search_path @search_path end |
Instance Method Details
- (Object) all
87 88 89 |
# File '../../library/general/src/modules/Hooks.rb', line 87 def all hooks.values end |
- (Boolean) exists?(hook_name)
91 92 93 |
# File '../../library/general/src/modules/Hooks.rb', line 91 def exists?(hook_name) !!find(hook_name) end |
- (Object) find(hook_name)
83 84 85 |
# File '../../library/general/src/modules/Hooks.rb', line 83 def find(hook_name) hooks[hook_name] end |
- (Object) run(hook_name)
74 75 76 77 78 79 80 81 |
# File '../../library/general/src/modules/Hooks.rb', line 74 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 |