Module: ActiveJson::CLI

Defined in:
lib/cli.rb

Class Method Summary collapse

Class Method Details

.reject(json, where:, pluck: nil) ⇒ Object



14
15
16
17
18
# File 'lib/cli.rb', line 14

def reject(json, where:, pluck: nil)
  data = parse_json(json)
  filter, pluck = build_query(where, pluck)
  Query.reject(data, where: filter, pluck: pluck)
end

.select(json, where:, pluck: nil) ⇒ Object



8
9
10
11
12
# File 'lib/cli.rb', line 8

def select(json, where:, pluck: nil)
  data = parse_json(json)
  filter, pluck = build_query(where, pluck)
  Query.select(data, where: filter, pluck: pluck)
end