module JSON::OnSteroids::MergeOperations

Direct including types

Defined in:

json_on_steroids/merge_operations.cr

Instance Method Summary

Instance Method Detail

def %(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}

[View source]
def -(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}

[View source]
def merge(x : NamedTuple) #

[View source]
def merge(x : JSON::OnSteroids | JSON::Any) #

[View source]
def merge!(x : NamedTuple) #

[View source]
def merge!(x : JSON::OnSteroids | JSON::Any) #

[View source]