Module: ActiveJson::Query
Instance Method Summary collapse
Instance Method Details
#reject(data, where:, pluck: nil) ⇒ Object
12 13 14 15 |
# File 'lib/active_json/query.rb', line 12 def reject(data, where:, pluck: nil) result = data.reject(&apply_filters(where)) pluck ? result.map(&pluck_attributes(pluck)).compact : result end |
#select(data, where:, pluck: nil) ⇒ Object
7 8 9 10 |
# File 'lib/active_json/query.rb', line 7 def select(data, where:, pluck: nil) result = data.select(&apply_filters(where)) pluck ? result.map(&pluck_attributes(pluck)).compact : result end |