Extensions
Define extensions that can be later enabled by the user.
require 'dry/core/extensions'
class Foo
extend Dry::Core::Extensions
register_extension(:bar) do
def bar; :bar end
end
end
Foo.new.bar # => NoMethodError
Foo.load_extensions(:bar)
Foo.new.bar # => :bar