class Dry::Initializer::Struct

def __hashify(value)

def __hashify(value)
  case value
  when Hash
    value.each_with_object({}) { |(k, v), obj| obj[k.to_s] = __hashify(v) }
  when Array then value.map { |v| __hashify(v) }
  when Dry::Initializer::Struct then value.to_h
  else value
  end
end

def new(options)

def new(options)
  super(**Hash(options).each_with_object({}) { |(k, v), h| h[k.to_sym] = v })
end

def to_h

Returns:
  • (Hash) -
def to_h
  self
    .class
    .dry_initializer
    .attributes(self)
    .each_with_object({}) { |(k, v), h| h[k.to_s] = __hashify(v) }
end