Sha256: 349eebb6a4021a640a9ae14a5288b8b6fc2a459fc7ec919bffbdddf0b4774ca0

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

# @pai private
# @since 0.1.0
class SmartCore::Initializer::Attribute::Finalizer::InstanceMethod
  # @param finalizer [String, Symbol]
  # @return [void]
  #
  # @api private
  # @since 0.1.0
  def initialize(finalizer)
    @finalizer = finalizer
  end

  # @param value [Any]
  # @param instance [Any]
  # @return [value]
  #
  # @pai private
  # @since 0.1.0
  def call(value, instance)
    instance.send(finalizer, value)
  end

  private

  # @return [NilClass, Any]
  #
  # @api private
  # @since 0.1.0
  attr_reader :finalizer
end

Version data entries

1 entries across 1 versions & 1 rubygems

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