Sha256: 47c26c25a7168282dbc8faa3cf1ddbbac62c0f0af78e064346ab5149c6872619

Contents?: true

Size: 644 Bytes

Versions: 19

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

module SmartCore::Initializer::Attribute::Finalizer
  # @pai private
  # @since 0.1.0
  class AnonymousBlock < Abstract
    # @param finalizer [Proc]
    # @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.instance_exec(value, &finalizer)
    end

    private

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
smart_initializer-0.11.1 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.11.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.10.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.9.1 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.9.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.8.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.7.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.6.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.5.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.4.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.3.2 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.3.1 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.3.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.2.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.1.0 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.1.0.alpha4 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.1.0.alpha3 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.1.0.alpha2 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
smart_initializer-0.1.0.alpha1 lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb