module Dry::Types::Meta

def initialize(*args, meta: EMPTY_HASH, **options)

def initialize(*args, meta: EMPTY_HASH, **options)
  super(*args, **options)
  @meta = meta.freeze
end

def meta(data = nil)

Other tags:
    Api: - public

Returns:
  • (Type) - new type with added metadata
  • (Hash) - metadata associated with type

Parameters:
  • new (Hash) -- metadata to merge into existing metadata

Overloads:
  • meta(data)
  • meta
def meta(data = nil)
  if !data
    @meta
  elsif data.empty?
    self
  else
    with(meta: @meta.merge(data))
  end
end

def pristine

Other tags:
    Api: - public

Returns:
  • (Dry::Types::Type) -
def pristine
  with(meta: EMPTY_HASH)
end

def with(**options)

Other tags:
    Api: - public

Returns:
  • (Type) -

Parameters:
  • new_options (Hash) --
def with(**options)
  super(meta: @meta, **options)
end