Module: Pharrell
- Defined in:
- lib/pharrell.rb,
lib/pharrell/config.rb,
lib/pharrell/injectible.rb
Defined Under Namespace
Modules: Injectible
Classes: Config
Constant Summary
collapse
- @@configs =
{}
- @@config =
nil
Class Method Summary
collapse
Class Method Details
.config(name, opts = {}, &blk) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/pharrell.rb', line 8
def self.config(name, opts = {}, &blk)
if opts[:extends]
@@configs[name] = @@configs[opts[:extends]].extend(blk)
else
@@configs[name] = Config.new(blk)
end
end
|
.current_config ⇒ Object
31
32
33
|
# File 'lib/pharrell.rb', line 31
def self.current_config
@@configs[@@config]
end
|
.instance_for(klass) ⇒ Object
21
22
23
|
# File 'lib/pharrell.rb', line 21
def self.instance_for(klass)
current_config.instance_for(klass)
end
|
.rebuild! ⇒ Object
25
26
27
|
# File 'lib/pharrell.rb', line 25
def self.rebuild!
current_config.rebuild!
end
|
.use_config(name) ⇒ Object
16
17
18
19
|
# File 'lib/pharrell.rb', line 16
def self.use_config(name)
@@config = name
rebuild!
end
|