Module: Dry::Types::Options

Included in:
Definition, Sum
Defined in:
lib/dry/types/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#meta(data = nil) ⇒ Object (readonly)

Returns the value of attribute meta.



6
7
8
# File 'lib/dry/types/options.rb', line 6

def meta
  @meta
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/dry/types/options.rb', line 4

def options
  @options
end

Instance Method Details

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



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

def initialize(*args, **options )
  @__args__ = args
  @options = options
  @meta = options.fetch(:meta, {})
end

#with(new_options) ⇒ Object



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

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