Class: KairosDB::Config
- Inherits:
-
Object
- Object
- KairosDB::Config
- Defined in:
- lib/kairosdb/config.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#initial_delay ⇒ Object
Returns the value of attribute initial_delay.
-
#max_delay ⇒ Object
Returns the value of attribute max_delay.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#port ⇒ Object
Returns the value of attribute port.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#retry ⇒ Object
Returns the value of attribute retry.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(opts = {}) ⇒ Config
Returns a new instance of Config.
14 15 16 17 18 19 20 21 22 |
# File 'lib/kairosdb/config.rb', line 14 def initialize(opts = {}) @host = opts.fetch(:host, 'localhost') @port = opts.fetch(:port, 8080) @initial_delay = opts.fetch(:initial_delay, 0.01) @max_delay = opts.fetch(:max_delay, 30) @open_timeout = opts.fetch(:write_timeout, 5) @read_timeout = opts.fetch(:read_timeout, 300) @retry = opts.fetch(:retry, 3) end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/kairosdb/config.rb', line 3 def host @host end |
#initial_delay ⇒ Object
Returns the value of attribute initial_delay.
3 4 5 |
# File 'lib/kairosdb/config.rb', line 3 def initial_delay @initial_delay end |
#max_delay ⇒ Object
Returns the value of attribute max_delay.
3 4 5 |
# File 'lib/kairosdb/config.rb', line 3 def max_delay @max_delay end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
3 4 5 |
# File 'lib/kairosdb/config.rb', line 3 def open_timeout @open_timeout end |
#port ⇒ Object
Returns the value of attribute port.
3 4 5 |
# File 'lib/kairosdb/config.rb', line 3 def port @port end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
3 4 5 |
# File 'lib/kairosdb/config.rb', line 3 def read_timeout @read_timeout end |
#retry ⇒ Object
Returns the value of attribute retry.
3 4 5 |
# File 'lib/kairosdb/config.rb', line 3 def retry @retry end |