Module: LLT::Helpers::Configuration::ClassMethods
- Defined in:
- lib/llt/helpers/configuration.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &blk) ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/llt/helpers/configuration.rb', line 34
def method_missing(meth, *args, &blk)
if meth.to_s.match(/^uses_(.*)/)
configuration[$1.to_sym] = [blk.call, blk]
else
super
end
end
|
Instance Method Details
#configuration ⇒ Object
24
25
26
|
# File 'lib/llt/helpers/configuration.rb', line 24
def configuration
@configuration ||= {}
end
|
#reload! ⇒ Object
28
29
30
31
32
|
# File 'lib/llt/helpers/configuration.rb', line 28
def reload!
configuration.each do |_, arr|
arr[0] = arr[1].call
end
end
|