module Net::IMAP::Config::AttrInheritance

def self.attr_accessor(name) # :nodoc: internal API

:nodoc: internal API
def self.attr_accessor(name) # :nodoc: internal API
  module_eval <<~RUBY, __FILE__, __LINE__ + 1
    def #{name}; (val = super) == INHERITED ? parent&.#{name} : val end
  RUBY
end

def self.included(mod)

def self.included(mod)
  mod.extend Macros
end

def inherited?(attr) data[attr] == INHERITED end

by this config.
Returns +true+ if +attr+ is inherited from #parent and not overridden
def inherited?(attr) data[attr] == INHERITED end

def initialize(parent = nil) # :notnew:

:notnew:
def initialize(parent = nil) # :notnew:
  super()
  @parent = Config[parent]
  reset
end

def initialize_copy(other)

def initialize_copy(other)
  super
  @parent ||= other # only default has nil parent
end

def new(**attrs) self.class.new(self, **attrs) end

Creates a new config, which inherits from +self+.
def new(**attrs) self.class.new(self, **attrs) end

def reset(attr = nil)

When +attr+ is nil or not given, all attributes are reset.

Resets an +attr+ to inherit from the #parent config.

reset(attr) -> attribute value
reset -> self
:call-seq:
def reset(attr = nil)
  if attr.nil?
    data.members.each do |attr| data[attr] = INHERITED end
    self
  elsif inherited?(attr)
    nil
  else
    old, data[attr] = data[attr], INHERITED
    old
  end
end