Sha256: 47277b014ad3a1192c36cd89f2a1a7e08070a0e397c9c53559f81edce0b637bb

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class SmartCore::Initializer::Attribute
  require_relative 'attribute/parameters'
  require_relative 'attribute/list'
  require_relative 'attribute/finalizer'
  require_relative 'attribute/definer'
  require_relative 'attribute/factory'

  # @since 0.1.0
  extend Forwardable

  # @retirn [String]
  #
  # @since 0.1.0
  # @version 0.1.0
  def_delegator :parameters, :name

  # @retirn [SmartCore::Types::Primitive]
  #
  # @since 0.1.0
  # @version 0.1.0
  def_delegator :parameters, :type

  # @retirn [Symbol]
  #
  # @since 0.1.0
  # @version 0.1.0
  def_delegator :parameters, :privacy

  # @retirn [SmartCore::Initializer::Attribute::Finalizer::AnonymousBlock/InstanceMethod]
  #
  # @since 0.1.0
  # @version 0.1.0
  def_delegator :parameters, :finalizer

  # @retirn [Boolean]
  #
  # @since 0.1.0
  # @version 0.1.0
  def_delegator :parameters, :cast

  # @param name [String]
  # @param type [SmartCore::Types::Primitive]
  # @param privacy [Symbol]
  # @param finalizer [SmartCore::Initializer::Attribute::Finalizer::AnonymousBlock/InstanceMethod]
  # @param cast [Boolean]
  # @param dynamic_options [Hash<Symbol,Any>]
  # @return [void]
  #
  # @api private
  # @since 0.1.0
  def initialize(name, type, privacy, finalizer, cast, dynamic_options)
    @parameters = SmartCore::Initializer::Attribute::Parameters.new(
      name, type, privacy, finalizer, cast, dynamic_options
    )
  end

  private

  # @return [SmartCore::Initializer::Attribute::Parameters]
  #
  # @api private
  # @since 0.1.0
  attr_reader :parameters
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smart_initializer-0.0.0 lib/smart_core/initializer/attribute.rb