Class: Qa::LDF::Configuration
- Inherits:
-
Object
- Object
- Qa::LDF::Configuration
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/qa/ldf/configuration.rb
Overview
A singleton configuration class.
This behaves much like a hash, but guarantees that only one configuration exists and accepts a block sytax for configuration.
Instance Method Summary collapse
-
#[] ⇒ Object
Delegates to the underlying options.
-
#[]= ⇒ Object
Delegates to the underlying options.
-
#any? ⇒ Object
Delegates to the underlying options.
- #configure!(**opts) {|config| ... } ⇒ Object
-
#each ⇒ Object
Delegates to the underlying options.
-
#fetch ⇒ Object
Delegates to the underlying options.
-
#reset! ⇒ Object
Empties all configuration options.
-
#to_a ⇒ Object
Delegates to the underlying options.
-
#to_h ⇒ Object
Delegates to the underlying options.
Instance Method Details
#[] ⇒ Object
Delegates to the underlying options
31 |
# File 'lib/qa/ldf/configuration.rb', line 31 def_delegator :@options, :'[]', :'[]' |
#[]= ⇒ Object
Delegates to the underlying options
32 |
# File 'lib/qa/ldf/configuration.rb', line 32 def_delegator :@options, :'[]=', :'[]=' |
#any? ⇒ Object
Delegates to the underlying options
33 |
# File 'lib/qa/ldf/configuration.rb', line 33 def_delegator :@options, :any?, :any? |
#configure!(**opts) {|config| ... } ⇒ Object
52 53 54 55 56 |
# File 'lib/qa/ldf/configuration.rb', line 52 def configure!(**opts) @options = opts yield self if block_given? self end |
#each ⇒ Object
Delegates to the underlying options
34 |
# File 'lib/qa/ldf/configuration.rb', line 34 def_delegator :@options, :each, :each |
#fetch ⇒ Object
Delegates to the underlying options
35 |
# File 'lib/qa/ldf/configuration.rb', line 35 def_delegator :@options, :fetch, :fetch |
#reset! ⇒ Object
Empties all configuration options
62 63 64 |
# File 'lib/qa/ldf/configuration.rb', line 62 def reset! @options = {} end |
#to_a ⇒ Object
Delegates to the underlying options
36 |
# File 'lib/qa/ldf/configuration.rb', line 36 def_delegator :@options, :to_a, :to_a |
#to_h ⇒ Object
Delegates to the underlying options
37 |
# File 'lib/qa/ldf/configuration.rb', line 37 def_delegator :@options, :to_h, :to_h |