Sha256: d1257ac4f1dfc06a79ac3a7ce8204ac9e4e4e1854563a1cddd3c470dc5142f8e

Contents?: true

Size: 419 Bytes

Versions: 3

Compression:

Stored size: 419 Bytes

Contents

# frozen_string_literal: true

module Dry
  module Core
    class Container
      class Item
        # Callable class to returns a item call
        #
        # @api public
        #
        class Callable < Item
          # Returns the result of item call or item
          #
          # @return [Mixed]
          def call
            callable? ? item.call : item
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dry-core-1.0.2 lib/dry/core/container/item/callable.rb
dry-core-1.0.1 lib/dry/core/container/item/callable.rb
dry-core-1.0.0 lib/dry/core/container/item/callable.rb