Module: NQL::Syntax::Comparator0

Defined in:
lib/nql/grammar.rb

Instance Method Summary collapse

Instance Method Details

#to_ransackObject



446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/nql/grammar.rb', line 446

def to_ransack
  comparators = {
    '=' => 'eq',
    '!=' => 'not_eq',
    '>' => 'gt',
    '>=' => 'gteq',
    '<' => 'lt',
    '<=' => 'lteq',
    ':' => 'cont',
    '!:' => 'not_cont',
    '~' => 'matches'
  }
  comparators[text_value]
end