Class: Traquitana::Config
- Inherits:
-
Object
- Object
- Traquitana::Config
show all
- Includes:
- Singleton
- Defined in:
- lib/config.rb
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
7
8
9
|
# File 'lib/config.rb', line 7
def initialize
@configs = {}
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth) ⇒ Object
27
28
29
30
|
# File 'lib/config.rb', line 27
def method_missing(meth)
c = @configs[meth.to_sym]
c ? c : ""
end
|
Instance Method Details
#config ⇒ Object
15
16
17
|
# File 'lib/config.rb', line 15
def config
"#{dir}/config.yml"
end
|
#default ⇒ Object
19
20
21
|
# File 'lib/config.rb', line 19
def default
"#{File.dirname(File.expand_path(__FILE__))}/../config/default.yml"
end
|
#dir ⇒ Object
11
12
13
|
# File 'lib/config.rb', line 11
def dir
"traq"
end
|
#load ⇒ Object
23
24
25
|
# File 'lib/config.rb', line 23
def load
@configs = YAML.load(File.read(config))
end
|