Class: Alf::Support::Config
- Inherits:
-
Object
- Object
- Alf::Support::Config
- Defined in:
- lib/alf-support/alf/support/config.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ Config
constructor
Creates a default options instance.
-
#merge(h) ⇒ Object
Merge with another options from a hash.
Constructor Details
#initialize(h = {}) ⇒ Config
Creates a default options instance
33 34 35 |
# File 'lib/alf-support/alf/support/config.rb', line 33 def initialize(h = {}) (h) end |
Class Method Details
.delegation_methods ⇒ Object
5 6 7 |
# File 'lib/alf-support/alf/support/config.rb', line 5 def self.delegation_methods public_instance_methods(false).reject{|m| m.to_s =~ /=$/ } end |
.helpers(to = :config) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/alf-support/alf/support/config.rb', line 9 def self.helpers(to = :config) meths = delegation_methods Module.new do meths.each do |m| define_method(m){|*args, &bl| self.send(to).send(m, *args, &bl) } end end end |
Instance Method Details
#merge(h) ⇒ Object
Merge with another options from a hash
38 39 40 |
# File 'lib/alf-support/alf/support/config.rb', line 38 def merge(h) dup.(h) end |