provider/test_data/spec_formatter.rb
# TODO(alexstephen): Delete once deprecated is a real nested object.
# Takes nested objects using a layer1.layer2 notation and converts to a
# Nested Object style hash.
Delete once deprecated is a real nested object.
Takes nested objects using a layer1.layer2 notation and converts to a
Nested Object style hash.
Delete once deprecated is a real nested object . Takes nested objects using a layer1 . layer2 notation and converts to a Nested Object style hash .
def emit_fake_nested_block(props, seed, extra, ctx)
        unnested = props.map do |p|
          emit_manifest_assign(p, seed, ctx, p.method(:field_name), true)
        end
                        .to_h
                        .merge(extra.map { |k, v| [k.id2name, v] }.to_h)
                        .to_h
        nested = {}
        unnested.each do |k, v|
          parts = k.split('.')
          nested[parts[0]] = {} unless nested.key?(parts[0])
          nested[parts[0]][parts[1]] = v
        end
        nested
      end
def emit_fake_nested_block ( props , seed , extra , ctx ) unnested = props . map do | p | emit_manifest_assign ( p , seed , ctx , p . method ( :field_name ) , true ) end . to_h . merge ( extra . map { | k , v | [ k . id2name , v ] } . to_h ) . to_h nested = { } unnested . each do | k , v | parts = k . split ( '.' ) nested [ parts [ 0 ] ] = { } unless nested . key? ( parts [ 0 ] ) nested [ parts [ 0 ] ] [ parts [ 1 ] ] = v end nested end
TODO(alexstephen): Delete once deprecated is a real nested object.
TODO ( alexstephen ) : Delete once deprecated is a real nested object .
props
<not_specific>
seed
<not_specific>
extra
<not_specific>
ctx
<not_specific>