Sha256: 7477f48ea7976f32c2bf9449c73d650b4260043a4b7aed71a1b8074dd9a9ba08
Contents?: true
Size: 1.21 KB
Versions: 6
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true require "forwardable" class Serega # # Core class that stores serializer configuration # class Config module ConfigInstanceMethods extend Forwardable # @return [Hash] Current config data attr_reader :opts # # Initializes new config instance and deeply duplicates all provided options to # remove possibility of accidental overwriting of parent/nested configs. # # @param opts [Hash] Initial config options # def initialize(opts = {}) @opts = Utils::EnumDeepDup.call(opts) end # # @!method [](name) # Get config option, delegates to opts#[] # @param name [Symbol] option name # @return [Object] # # @!method []=(name) # Set config option, delegates to opts#[]= # @param name [Symbol] option name # @return [Object] # # @!method fetch(name) # Fetch config option, delegates to opts#fetch # @param name [Symbol] option name # @return [Object] # def_delegators :opts, :[], :[]=, :fetch, :keys, :has_key? end include ConfigInstanceMethods extend Serega::Helpers::SerializerClassHelper end end
Version data entries
6 entries across 6 versions & 1 rubygems