Module: Dry::Types::Options Private

Included in:
Composition, Decorator, Nominal
Defined in:
lib/dry/types/options.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Common API for types with options

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsHash (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



10
11
12
# File 'lib/dry/types/options.rb', line 10

def options
  @options
end

Instance Method Details

#initialize(*args, **options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

See Also:



15
16
17
18
# File 'lib/dry/types/options.rb', line 15

def initialize(*args, **options)
  @__args__ = args.freeze
  @options = options.freeze
end

#with(**new_options) ⇒ Type

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • new_options (Hash)

Returns:



25
26
27
# File 'lib/dry/types/options.rb', line 25

def with(**new_options)
  self.class.new(*@__args__, **options, **new_options)
end