Class: Sisal::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/sisal/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
# File 'lib/sisal/configuration.rb', line 6

def initialize
  @providers = {}
end

Instance Attribute Details

#default_providerObject



17
18
19
# File 'lib/sisal/configuration.rb', line 17

def default_provider
  @providers[@default_provider.to_s]
end

#providersObject

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

Yields:

  • ()


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