Class: Mutant::Hooks::Builder Private
- Inherits:
-
Object
- Object
- Mutant::Hooks::Builder
- Defined in:
- lib/mutant/hooks.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize ⇒ Builder
constructor
private
A new instance of Builder.
- #register(name, &block) ⇒ Object private
- #to_hooks ⇒ Object private
Constructor Details
Instance Method Details
#register(name, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
52 53 54 55 56 57 58 |
# File 'lib/mutant/hooks.rb', line 52 def register(name, &block) Hooks.assert_name(name) @map.fetch(name) << block self end |
#to_hooks ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
60 61 62 |
# File 'lib/mutant/hooks.rb', line 60 def to_hooks Hooks.new(map: @map.transform_values(&:freeze).freeze) end |