Class: Hooksmith::Config::Provider
- Inherits:
-
Object
- Object
- Hooksmith::Config::Provider
- Defined in:
- lib/hooksmith/config/provider.rb
Overview
Provider is used internally by the DSL to collect processor registrations.
Instance Attribute Summary collapse
-
#entries ⇒ Array<Hash>
readonly
List of entries registered.
-
#provider ⇒ Symbol, String
readonly
The provider name.
Instance Method Summary collapse
-
#initialize(provider) ⇒ Provider
constructor
A new instance of Provider.
-
#register(event, processor_class_name) ⇒ Object
Registers a processor for a specific event.
Constructor Details
#initialize(provider) ⇒ Provider
Returns a new instance of Provider.
12 13 14 15 |
# File 'lib/hooksmith/config/provider.rb', line 12 def initialize(provider) @provider = provider @entries = [] end |
Instance Attribute Details
#entries ⇒ Array<Hash> (readonly)
Returns list of entries registered.
10 11 12 |
# File 'lib/hooksmith/config/provider.rb', line 10 def entries @entries end |
#provider ⇒ Symbol, String (readonly)
Returns the provider name.
8 9 10 |
# File 'lib/hooksmith/config/provider.rb', line 8 def provider @provider end |
Instance Method Details
#register(event, processor_class_name) ⇒ Object
Registers a processor for a specific event.
21 22 23 |
# File 'lib/hooksmith/config/provider.rb', line 21 def register(event, processor_class_name) entries << { event: event.to_sym, processor: processor_class_name } end |