Class: Splat::Configuration
- Inherits:
-
Object
- Object
- Splat::Configuration
- Defined in:
- lib/splat/configuration.rb
Overview
Singleton class
Constant Summary collapse
- @@configuration =
Configuration.new
Class Method Summary collapse
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #vendor(vendor = "default") ⇒ Object
- #vendors ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 |
# File 'lib/splat/configuration.rb', line 10 def initialize @options = YAML.load_file('config/splat.yml') @options = @options.merge YAML.load_file('config/vendors.yml') end |
Class Method Details
.instance ⇒ Object
15 16 17 |
# File 'lib/splat/configuration.rb', line 15 def self.instance @@configuration end |
Instance Method Details
#all ⇒ Object
23 24 25 |
# File 'lib/splat/configuration.rb', line 23 def all @options end |
#vendor(vendor = "default") ⇒ Object
19 20 21 |
# File 'lib/splat/configuration.rb', line 19 def vendor(vendor = "default") @options[vendor.to_s] end |
#vendors ⇒ Object
27 28 29 |
# File 'lib/splat/configuration.rb', line 27 def vendors @options.keys end |