class Codeclimate::Collectors::Configuration
The configuration for a collector client. Used like a Hash
. Treats all keys as symbols.
Attributes
storage[R]
Public Class Methods
new(attrs = {})
click to toggle source
# File lib/codeclimate/collectors/configuration.rb, line 6 def initialize(attrs = {}) @storage = attrs.deep_symbolize_keys end
Public Instance Methods
[](key)
click to toggle source
# File lib/codeclimate/collectors/configuration.rb, line 10 def [](key) storage[key.to_sym] end
[]=(key, val)
click to toggle source
# File lib/codeclimate/collectors/configuration.rb, line 14 def []=(key, val) storage[key.to_sym] = val end
fetch(*args)
click to toggle source
# File lib/codeclimate/collectors/configuration.rb, line 18 def fetch(*args) case args.count when 1 storage.fetch(args[0].to_sym) when 2 storage.fetch(args[0].to_sym, args[1]) else raise ArgumentError, "expected 1 or 2 arguments" end end