Sha256: e9d25c76c1ec992a37d231acee288476f19f0128d487a6c5580a0f433844145e

Contents?: true

Size: 397 Bytes

Versions: 5

Compression:

Stored size: 397 Bytes

Contents

# frozen_string_literal: true

require "dry/container/item"

module Dry
  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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-container-0.11.0 lib/dry/container/item/callable.rb
dry-container-0.10.1 lib/dry/container/item/callable.rb
dry-container-0.10.0 lib/dry/container/item/callable.rb
dry-container-0.9.0 lib/dry/container/item/callable.rb
dry-container-0.8.0 lib/dry/container/item/callable.rb