Class: DruidClient::DruidConfig
- Inherits:
-
Object
- Object
- DruidClient::DruidConfig
- Defined in:
- lib/druid_client/druid_config.rb
Constant Summary collapse
- DEFAULTS =
{ url: 'http://localhost:8888', user_agent: 'druid_client.rb', timeout: 30, verify_ssl: true, log_headers: false, log_bodies: false }.freeze
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(**options) {|_self| ... } ⇒ DruidConfig
constructor
A new instance of DruidConfig.
- #keys ⇒ Object
- #verify! ⇒ Object
Constructor Details
#initialize(**options) {|_self| ... } ⇒ DruidConfig
Returns a new instance of DruidConfig.
16 17 18 19 20 |
# File 'lib/druid_client/druid_config.rb', line 16 def initialize(**) = DEFAULTS.merge() yield self if block_given? end |
Instance Method Details
#[](key) ⇒ Object
32 33 34 |
# File 'lib/druid_client/druid_config.rb', line 32 def [](key) [key] end |
#keys ⇒ Object
28 29 30 |
# File 'lib/druid_client/druid_config.rb', line 28 def keys .keys end |
#verify! ⇒ Object
22 23 24 25 26 |
# File 'lib/druid_client/druid_config.rb', line 22 def verify! return if [:url].to_s.size.positive? raise ConfigError, 'Missing url in DruidConfig' end |