Class: SmartQue::Config
- Inherits:
-
Object
- Object
- SmartQue::Config
- Defined in:
- lib/smart_que/config.rb
Constant Summary collapse
- CONFIGURATION =
Configurations allowed configurations
%w(host port queues env username password logfile logger)
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
Initialize.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize ⇒ Config
Initialize
8 9 10 11 |
# File 'lib/smart_que/config.rb', line 8 def initialize @config = {} load_configuration_from_yml end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/smart_que/config.rb', line 13 def method_missing(name, *args) setter = false name = name.to_s if name =~ /=$/ name = name.to_s.chop setter = true end super(name, args) unless CONFIGURATION.include?(name) if setter set(name, args.first) else get(name) end end |