Sha256: dd1a7b20f5c6ed00a0df0a31d0a8d243ba3822e0f795809d4e6bee2f5f0e5259
Contents?: true
Size: 953 Bytes
Versions: 6
Compression:
Stored size: 953 Bytes
Contents
# simple-immutable Turns a nested data structure into a immutable ruby object implementing dot and [] accessors. ## Usage Immutable = ::Simple::Immutable data = { a: "a-value", "b": "b-value", "child": { name: "childname", grandchild: { name: "grandchildname" } }, "children": [ "anna", "arthur", { action: { keep_your_mouth_shut: true } } ] } imm = Immutable.create(data) imm.a # -> 'a-value' imm.children.class # -> Array imm.children[2].action.keep_your_mouth_shut # -> true imm.children.foo # NoMethodError (undefined method `foo' for #<Array:0x00007fb90f1be390>) imm.children.first.foo # NoMethodError (undefined method `foo' for "anna":String)
Version data entries
6 entries across 6 versions & 1 rubygems