Module: Resilience::Conf

Included in:
Image
Defined in:
lib/resilience/conf.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.confObject



10
11
12
# File 'lib/resilience/conf.rb', line 10

def self.conf
  @conf ||= {}
end

.method_missing(method, *args) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/resilience/conf.rb', line 14

def self.method_missing(method, *args)
  if method.to_s =~ /=$/
    conf[method.to_s.match(/^(.*)=$/)[1].to_sym] = args.first
  elsif method.to_s =~ /\?$/
    !!conf[method.to_s.match(/^(.*)\?$/)[1].to_sym]
  else
    conf[method]
  end
end

Instance Method Details

#confObject



24
25
26
# File 'lib/resilience/conf.rb', line 24

def conf
  Conf
end