module Net::IMAP::Config::AttrAccessors
NOTE: This module is an internal implementation detail, with no guarantee of backward compatibility.
attr_accessor
values are stored in a struct rather than ivars, making it simpler to ensure that all config objects share a single object shape. This also simplifies iteration over all defined attributes.
Private Class Methods
attributes()
click to toggle source
# File net-imap-0.4.16/lib/net/imap/config/attr_accessors.rb, line 33 def self.attributes instance_methods.grep(/=\z/).map { _1.to_s.delete_suffix("=").to_sym } end
included(mod)
click to toggle source
# File net-imap-0.4.16/lib/net/imap/config/attr_accessors.rb, line 21 def self.included(mod) mod.extend Macros end
Public Instance Methods
freeze()
click to toggle source
Freezes the internal attributes struct, in addition to self
.
Calls superclass method
# File net-imap-0.4.16/lib/net/imap/config/attr_accessors.rb, line 51 def freeze data.freeze super end
Protected Instance Methods
initialize()
click to toggle source
Calls superclass method
# File net-imap-0.4.16/lib/net/imap/config/attr_accessors.rb, line 45 def initialize # :notnew: super() @data = AttrAccessors.struct.new end
Private Instance Methods
initialize_clone(other)
click to toggle source
Calls superclass method
# File net-imap-0.4.16/lib/net/imap/config/attr_accessors.rb, line 62 def initialize_clone(other) super @data = other.data.clone end
initialize_dup(other)
click to toggle source
Calls superclass method
# File net-imap-0.4.16/lib/net/imap/config/attr_accessors.rb, line 67 def initialize_dup(other) super @data = other.data.dup end