Class: Pod::HooksManager::Hook
- Inherits:
-
Object
- Object
- Pod::HooksManager::Hook
- Defined in:
- lib/cocoapods/hooks_manager.rb
Overview
Represents a single registered hook.
Instance Attribute Summary collapse
-
#block ⇒ Proc
readonly
The block.
-
#name ⇒ String
readonly
The name of the hook.
-
#plugin_name ⇒ String
readonly
The name of the plugin that registered the hook.
Instance Method Summary collapse
-
#initialize(name, plugin_name, block) ⇒ Hook
constructor
Initialize a new instance.
Constructor Details
#initialize(name, plugin_name, block) ⇒ Hook
Initialize a new instance
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cocoapods/hooks_manager.rb', line 45 def initialize(name, plugin_name, block) raise ArgumentError, 'Missing name' unless name raise ArgumentError, 'Missing block' unless block UI.warn '[Hooks] The use of hooks without specifying a `plugin_name` ' \ "has been deprecated (from file `#{block.binding.eval('File.expand_path __FILE__')}`)." unless plugin_name @name = name @plugin_name = plugin_name @block = block end |
Instance Attribute Details
#block ⇒ Proc (readonly)
Returns The block.
35 36 37 |
# File 'lib/cocoapods/hooks_manager.rb', line 35 def block @block end |
#name ⇒ String (readonly)
Returns The name of the hook.
30 31 32 |
# File 'lib/cocoapods/hooks_manager.rb', line 30 def name @name end |
#plugin_name ⇒ String (readonly)
Returns The name of the plugin that registered the hook.
25 26 27 |
# File 'lib/cocoapods/hooks_manager.rb', line 25 def plugin_name @plugin_name end |