Sha256: 220bfda929bc835632bf0a00b8d4f8da0207ce15d9edf4a5f2a93f1759e19d89

Contents?: true

Size: 644 Bytes

Versions: 13

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

module SmartCore::Initializer::Attribute::Finalizer
  # @pai private
  # @since 0.1.0
  class InstanceMethod < Abstract
    # @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
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
smart_initializer-0.7.0 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.6.0 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.5.0 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.4.0 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.3.2 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.3.1 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.3.0 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.2.0 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.1.0 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.1.0.alpha4 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.1.0.alpha3 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.1.0.alpha2 lib/smart_core/initializer/attribute/finalizer/instance_method.rb
smart_initializer-0.1.0.alpha1 lib/smart_core/initializer/attribute/finalizer/instance_method.rb