parent
0ab6328fac
commit
419001cdfa
|
@ -95,13 +95,7 @@ module Dry
|
|||
#
|
||||
# @api public
|
||||
def to_ast(meta: true)
|
||||
opts = if RUBY_VERSION >= "2.5"
|
||||
options.slice(:type_transform_fn)
|
||||
else
|
||||
options.select { |k, _| k == :type_transform_fn }
|
||||
end
|
||||
|
||||
[:hash, [opts, meta ? self.meta : EMPTY_HASH]]
|
||||
[:hash, [options.slice(:type_transform_fn), meta ? self.meta : EMPTY_HASH]]
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -145,18 +145,10 @@ module Dry
|
|||
#
|
||||
# @api public
|
||||
def to_ast(meta: true)
|
||||
if RUBY_VERSION >= "2.5"
|
||||
opts = options.slice(:key_transform_fn, :type_transform_fn, :strict)
|
||||
else
|
||||
opts = options.select { |k, _|
|
||||
k == :key_transform_fn || k == :type_transform_fn || k == :strict
|
||||
}
|
||||
end
|
||||
|
||||
[
|
||||
:schema,
|
||||
[keys.map { |key| key.to_ast(meta: meta) },
|
||||
opts,
|
||||
options.slice(:key_transform_fn, :type_transform_fn, :strict),
|
||||
meta ? self.meta : EMPTY_HASH]
|
||||
]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue