JSON::OnSteroids::MergeOperations
Instance methods
%(t : Enumerable)
return a JSON object containing only the JSON fields requested in the argument enumerable
json = JSON.parse(%<{"a": 1, "b": 2, "c": [1,2,3]}>).on_steroid
json = json % {"a", "b"} # => {"a": 1, "b": 2}
-(t : Enumerable)
return a JSON object removing the JSON fields defined by the argument enumerable
json = JSON.parse(%<{"user": "yacine", "password": "helloworld"}>).on_steroid
json = json - {:password} # => {"a": 1, "b": 2}
merge(x : NamedTuple)
merge!(x : NamedTuple)