Class: MetricCollect::Config
- Inherits:
-
Object
- Object
- MetricCollect::Config
- Defined in:
- lib/metric_collect/config.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #method_missing(method_symbol, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/metric_collect/config.rb', line 20 def initialize() @params = Hash.new @params[:graphite_server] = "localhost" @params[:graphite_port] = "2003" @params[:statsd_server] = "localhost" @params[:statsd_port] = "8125" @params[:metrics_directory] = nil @params[:email_server] = nil @params[:email_from] = nil @params[:log_file] = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_symbol, *args, &block) ⇒ Object
32 33 34 35 |
# File 'lib/metric_collect/config.rb', line 32 def method_missing(method_symbol, *args, &block) @params[method_symbol] = args[0] block.call if block end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
37 38 39 |
# File 'lib/metric_collect/config.rb', line 37 def params @params end |