Class: Splat::Configuration

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

Overview

Singleton class

Constant Summary collapse

@@configuration =
Configuration.new

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

.instanceObject



15
16
17
# File 'lib/splat/configuration.rb', line 15

def self.instance
  @@configuration
end

Instance Method Details

#allObject



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

#vendorsObject



27
28
29
# File 'lib/splat/configuration.rb', line 27

def vendors
  @options.keys
end