Class: Zaikio::Webhooks::Configuration
- Inherits:
-
Object
- Object
- Zaikio::Webhooks::Configuration
- Defined in:
- lib/zaikio/webhooks/configuration.rb
Instance Attribute Summary collapse
-
#client_configurations ⇒ Object
readonly
Returns the value of attribute client_configurations.
- #logger ⇒ Object
Instance Method Summary collapse
- #all_client_names ⇒ Object
- #find!(name) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #register_client(name) {|| ... } ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 |
# File 'lib/zaikio/webhooks/configuration.rb', line 10 def initialize @client_configurations = {} end |
Instance Attribute Details
#client_configurations ⇒ Object (readonly)
Returns the value of attribute client_configurations.
8 9 10 |
# File 'lib/zaikio/webhooks/configuration.rb', line 8 def client_configurations @client_configurations end |
#logger ⇒ Object
14 15 16 |
# File 'lib/zaikio/webhooks/configuration.rb', line 14 def logger @logger ||= Logger.new($stdout) end |
Instance Method Details
#all_client_names ⇒ Object
27 28 29 |
# File 'lib/zaikio/webhooks/configuration.rb', line 27 def all_client_names client_configurations.keys end |
#find!(name) ⇒ Object
23 24 25 |
# File 'lib/zaikio/webhooks/configuration.rb', line 23 def find!(name) @client_configurations[name.to_s] or raise ActiveRecord::RecordNotFound end |
#register_client(name) {|| ... } ⇒ Object
18 19 20 21 |
# File 'lib/zaikio/webhooks/configuration.rb', line 18 def register_client(name) @client_configurations[name.to_s] ||= ClientConfiguration.new yield(@client_configurations[name.to_s]) end |