Class: Sisal::Configuration
- Inherits:
-
Object
- Object
- Sisal::Configuration
- Defined in:
- lib/sisal/configuration.rb
Instance Attribute Summary collapse
- #default_provider ⇒ Object
-
#providers ⇒ Object
Returns the value of attribute providers.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #provider(name, provider_object = nil) {|| ... } ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 |
# File 'lib/sisal/configuration.rb', line 6 def initialize @providers = {} end |
Instance Attribute Details
#default_provider ⇒ Object
17 18 19 |
# File 'lib/sisal/configuration.rb', line 17 def default_provider @providers[@default_provider.to_s] end |
#providers ⇒ Object
Returns the value of attribute providers.
3 4 5 |
# File 'lib/sisal/configuration.rb', line 3 def providers @providers end |
Instance Method Details
#provider(name, provider_object = nil) {|| ... } ⇒ Object
10 11 12 13 14 15 |
# File 'lib/sisal/configuration.rb', line 10 def provider(name, provider_object = nil) name = name.to_s @providers[name] = provider_object if provider_object yield(@providers[name]) if block_given? @providers[name] end |