Module: AppCfg

Defined in:
lib/appcfg.rb,
lib/appcfg/source.rb,
lib/appcfg/retrieval.rb,
lib/appcfg/sources/yaml_source.rb,
lib/appcfg/sources/model_source.rb

Defined Under Namespace

Classes: ModelSource, Source, YamlSource

Constant Summary collapse

@@cache =
{}

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/appcfg/retrieval.rb', line 2

def self.[](key)
  if @@cache.respond_to?(key)
    @@cache.send(key)
  else
    nil
  end
end

.method_missing(method_sym, *arguments, &block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/appcfg/retrieval.rb', line 10

def self.method_missing(method_sym, *arguments, &block)
  if @@cache.respond_to?(method_sym)
    @@cache.send(method_sym)
  else
    super
  end
end

.respond_to?(method_sym, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'lib/appcfg/retrieval.rb', line 18

def self.respond_to?(method_sym, include_private = false)
  if @@cache.respond_to?(method_sym)
    true
  else
    super
  end
end

.set_cache(data) ⇒ Object



2
3
4
# File 'lib/appcfg/source.rb', line 2

def self.set_cache data
  @@cache = data
end