class Serega::SeregaConfig::HashAccessConfig
Defaults of the hash_access: attribute option, config.hash_access
Public Instance Methods
() → bool
Source
# File lib/serega/config.rb, line 262 def default_allow_missing_key opts.fetch(:default_allow_missing_key) end
Whether a missing Hash key gives nil instead of raising KeyError. false by default.
(bool value) → bool
Source
# File lib/serega/config.rb, line 267 def default_allow_missing_key=(value) unless value == true || value == false raise SeregaError, "Invalid hash_access default_allow_missing_key #{value.inspect}. Must be a Boolean" end opts[:default_allow_missing_key] = value end
() → (:symbol | :string)
Source
# File lib/serega/config.rb, line 247 def default_mode opts.fetch(:default_mode) end
Mode of hash_access: true: :symbol (the default) or :string keys
(:symbol | :string value) → (:symbol | :string)
Source
# File lib/serega/config.rb, line 252 def default_mode=(value) unless AttributeValueResolvers::HashAccessResolver::MODES.include?(value) raise SeregaError, "Invalid hash_access default_mode #{value.inspect}. Allowed modes: :symbol, :string" end opts[:default_mode] = value end
Sets default_mode