Class: Honeybadger::Config::Mash Private

Inherits:
Object
  • Object
show all
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

Ruby

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

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_hashObject 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