Sha256: 418862676515869f06e1a287e969c284fa538af5dc395d69de5b1d83aca4905d

Contents?: true

Size: 1.33 KB

Versions: 71

Compression:

Stored size: 1.33 KB

Contents

{
  "schema_type": "object",
  "schema_version": "1.1",
  "name": "merge",
  "path": "packages/ree_hash/package/ree_hash/functions/merge.rb",
  "mount_as": "fn",
  "class": "ReeHash::Merge",
  "factory": null,
  "methods": [
    {
      "doc": "Returns a new hash with +first_hash+ and +other_hash+ merged recursively.\n\n  h1 = { a: true, b: { c: [1, 2, 3] } }\n  h2 = { a: false, b: { x: [3, 4, 5] } }\n\n  merge(h1, h2, deep: true) # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } }\n  merge(h1, h2, deep: false) # => { a: false, b: { x: [3, 4, 5] } }\n\nLike with Hash#merge in the standard library, a block can be provided\nto merge values:\n\n  h1 = { a: 100, b: 200, c: { c1: 100 } }\n  h2 = { b: 250, c: { c1: 200 } }\n\n  merge(h1, h2) { |key, this_val, other_val| this_val + other_val }\n    => { a: 100, b: 450, c: { c1: 300 } }",
      "throws": [

      ],
      "return": "Hash",
      "args": [
        {
          "arg": "first_hash",
          "arg_type": "req",
          "type": "Hash"
        },
        {
          "arg": "other_hash",
          "arg_type": "req",
          "type": "Hash"
        },
        {
          "arg": "deep",
          "arg_type": "key",
          "type": "Bool"
        },
        {
          "arg": "block",
          "arg_type": "block",
          "type": "Block"
        }
      ]
    }
  ],
  "links": [

  ]
}

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
ree_lib-1.0.103 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.102 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.101 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.100 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.99 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.98 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.97 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.96 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.95 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.94 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.93 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.92 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.91 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.90 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.89 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.88 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.87 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.86 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.85 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.84 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json