Sha256: cf38421d2d9c032fb1d0b64c1ab850fe934032145984f8e7fbbdafe6d3bc5fb7
Contents?: true
Size: 969 Bytes
Versions: 7
Compression:
Stored size: 969 Bytes
Contents
# frozen_string_literal: true # @api private # @since 0.5.0 module SmartCore::Initializer::InstanceAttributeAccessing # @return [Hash<Symbol,Any>] # # @api public # @since 0.5.0 def params __collect_params__ end # @return [Hash<Symbol,Any>] # # @api public # @since 0.5.0 def options __collect_options__ end # @return [Hash<Symbol,Any>] # # @api public # @since 0.5.0 def attributes __collect_params__.merge(__collect_options__) end # @return [Hash<Symbol,Any>] # # @api private # @since 0.5.0 def __collect_params__ self.class.__params__.each_with_object({}) do |param, memo| memo[param.name] = instance_variable_get("@#{param.name}") end end # @return [Hash<Symbol,Any>] # # @api private # @since 0.5.0 def __collect_options__ self.class.__options__.each_with_object({}) do |option, memo| memo[option.name] = instance_variable_get("@#{option.name}") end end end
Version data entries
7 entries across 7 versions & 1 rubygems