Method: DashApi::Query.format_filter

Defined in:
app/services/dash_api/query.rb

.format_filter(filter_param) ⇒ Object



66
67
68
69
70
71
72
# File 'app/services/dash_api/query.rb', line 66

def self.format_filter(filter_param)
  field, rel, value = filter_param.split(DELIMITER)
  rel = "eq" unless OPERATORS.keys.include?(rel.to_sym)      
  operator = OPERATORS[rel.to_sym] || '='   
  condition = "#{field} #{operator} ?"
  [condition, value]
end