Class: Dry::Container::Item::Callable

Inherits:
Dry::Container::Item show all
Defined in:
lib/dry/container/item/callable.rb

Overview

Callable class to returns a item call

Instance Attribute Summary

Attributes inherited from Dry::Container::Item

#item, #options

Instance Method Summary collapse

Methods inherited from Dry::Container::Item

#callable?, #initialize, #map, #value?

Constructor Details

This class inherits a constructor from Dry::Container::Item

Instance Method Details

#callMixed

Returns the result of item call or item

Returns:

  • (Mixed)


16
17
18
# File 'lib/dry/container/item/callable.rb', line 16

def call
  callable? ? item.call : item
end