Class: Praxis::Extensions::AttributeFiltering::FilteringParams::DSLCompiler

Inherits:
Attributor::DSLCompiler
  • Object
show all
Defined in:
lib/praxis/extensions/attribute_filtering/filtering_params.rb

Instance Method Summary collapse

Instance Method Details

#any(name, using: nil, fuzzy: false) ⇒ Object



44
45
46
# File 'lib/praxis/extensions/attribute_filtering/filtering_params.rb', line 44

def any(name, using: nil, fuzzy: false)
  target.add_any(name.to_sym, operators: Set.new(using), fuzzy: fuzzy)
end

#filter(name, using: nil, fuzzy: false) ⇒ Object

“account.id”: { operators: [“=”, “!=”] }, name: { operators: [“=”, “!=”], fuzzy_match: true }, start_date: { operators: [“!=”, “>=”, “<=”, “=”, “<”, “>”] }



40
41
42
# File 'lib/praxis/extensions/attribute_filtering/filtering_params.rb', line 40

def filter(name, using: nil, fuzzy: false)
  target.add_filter(name.to_sym, operators: Set.new(using), fuzzy: fuzzy)
end