Class: Konfig::Adapter
- Inherits:
-
Object
- Object
- Konfig::Adapter
- Defined in:
- lib/konfig/adapter.rb
Overview
All adapters are subclassed from Konfig::Adapter
Direct Known Subclasses
Class Method Summary collapse
-
.children ⇒ Array
Get all child classes.
-
.clear_children ⇒ Object
Remove child classes from registry.
-
.create_and_send_to_children(*args) ⇒ Object
Instanciates all child classes and envokes a method via obj.send.
- .inherited(child_class) ⇒ Object
-
.send_to_children(*args) ⇒ Object
Evokes the send method on all child classes, and passes the args along.
Class Method Details
.children ⇒ Array
Get all child classes
15 16 17 |
# File 'lib/konfig/adapter.rb', line 15 def children @children ||= [] end |
.clear_children ⇒ Object
Remove child classes from registry
20 21 22 |
# File 'lib/konfig/adapter.rb', line 20 def clear_children @children = [] end |
.create_and_send_to_children(*args) ⇒ Object
Instanciates all child classes and envokes a method via obj.send
32 33 34 |
# File 'lib/konfig/adapter.rb', line 32 def create_and_send_to_children(*args) children.each { |c| c.new.send(*args) } end |
.inherited(child_class) ⇒ Object
9 10 11 |
# File 'lib/konfig/adapter.rb', line 9 def inherited(child_class) children << child_class end |
.send_to_children(*args) ⇒ Object
Evokes the send method on all child classes, and passes the args along
26 27 28 |
# File 'lib/konfig/adapter.rb', line 26 def send_to_children(*args) children.each { |c| c.send(*args) } end |