Class: Honeybadger::Config::Mash Private
- Inherits:
-
Object
- Object
- Honeybadger::Config::Mash
- Defined in:
- lib/honeybadger/config/ruby.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Constant Summary collapse
- KEYS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
DEFAULTS.keys.map(&:to_s).freeze
Instance Method Summary collapse
-
#initialize(config, prefix: nil, hash: {}) ⇒ Mash
constructor
private
A new instance of Mash.
- #to_hash ⇒ Object (also: #to_h) private
Constructor Details
#initialize(config, prefix: nil, hash: {}) ⇒ Mash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Mash.
6 7 8 9 10 |
# File 'lib/honeybadger/config/ruby.rb', line 6 def initialize(config, prefix: nil, hash: {}) @config = config @prefix = prefix @hash = hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/honeybadger/config/ruby.rb', line 21 def method_missing(method_name, *args, &block) m = method_name.to_s if mash?(m) return Mash.new(config, prefix: key(m), hash: hash) elsif setter?(m) return hash.send(:[]=, key(m).to_sym, args[0]) elsif getter?(m) return get(key(m)) end super end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/honeybadger/config/ruby.rb', line 12 def to_hash hash.to_hash end |