Sha256: a1ce76339e06ea8caebb35f8c93d32ada54c14dd4142274128cb13289f144d16

Contents?: true

Size: 1.22 KB

Versions: 28

Compression:

Stored size: 1.22 KB

Contents

{
  "schema_type": "object",
  "schema_version": "1.0",
  "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",
          "type": "Hash"
        },
        {
          "arg": "other_hash",
          "type": "Hash"
        },
        {
          "arg": "deep",
          "type": "Bool"
        },
        {
          "arg": "block",
          "type": "Block"
        }
      ]
    }
  ],
  "links": [

  ]
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ree_lib-1.0.32 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.31 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.30 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.29 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.28 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.27 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.26 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.24 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.23 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.22 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.21 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.20 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.19 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.18 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.17 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.16 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.15 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.14 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.13 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json
ree_lib-1.0.12 lib/ree_lib/packages/ree_hash/schemas/ree_hash/functions/merge.schema.json