Class: MQ::FilterDSL
- Inherits:
-
Object
- Object
- MQ::FilterDSL
- Defined in:
- lib/mq/query.rb
Overview
DSL context for building filter expressions inside select/map blocks.
All methods return a Filter that can be combined with & and |.
Instance Method Summary collapse
- #add ⇒ Object
- #ascii_downcase ⇒ Object
- #ascii_upcase ⇒ Object
-
#contains(text) ⇒ Object
String matching.
- #empty ⇒ Object
- #ends_with(text) ⇒ Object
-
#eq(value) ⇒ Object
Comparison operators These compare the current pipeline value against the given argument.
- #gt(value) ⇒ Object
- #gte(value) ⇒ Object
-
#is_mdx ⇒ Object
Type checks.
- #is_nan ⇒ Object
- #is_none ⇒ Object
- #is_not_regex_match(pattern) ⇒ Object
-
#is_regex_match(pattern) ⇒ Object
Regex matching.
-
#length ⇒ Object
String transforms usable in filter context.
- #lt(value) ⇒ Object
- #lte(value) ⇒ Object
- #ne(value) ⇒ Object
-
#negate(filter) ⇒ Object
Negate a filter expression with not().
- #starts_with(text) ⇒ Object
- #test(pattern) ⇒ Object
- #trim ⇒ Object
- #type ⇒ Object
Instance Method Details
#ascii_downcase ⇒ Object
542 |
# File 'lib/mq/query.rb', line 542 def ascii_downcase = Filter.new("ascii_downcase()") |
#ascii_upcase ⇒ Object
543 |
# File 'lib/mq/query.rb', line 543 def ascii_upcase = Filter.new("ascii_upcase()") |
#contains(text) ⇒ Object
String matching
516 |
# File 'lib/mq/query.rb', line 516 def contains(text) = Filter.new("contains(#{text.inspect})") |
#ends_with(text) ⇒ Object
518 |
# File 'lib/mq/query.rb', line 518 def ends_with(text) = Filter.new("ends_with(#{text.inspect})") |
#eq(value) ⇒ Object
Comparison operators These compare the current pipeline value against the given argument.
527 |
# File 'lib/mq/query.rb', line 527 def eq(value) = Filter.new("eq(#{value.inspect})") |
#gt(value) ⇒ Object
529 |
# File 'lib/mq/query.rb', line 529 def gt(value) = Filter.new("gt(#{value.inspect})") |
#gte(value) ⇒ Object
530 |
# File 'lib/mq/query.rb', line 530 def gte(value) = Filter.new("gte(#{value.inspect})") |
#is_mdx ⇒ Object
Type checks
535 |
# File 'lib/mq/query.rb', line 535 def is_mdx = Filter.new("is_mdx()") |
#is_not_regex_match(pattern) ⇒ Object
523 |
# File 'lib/mq/query.rb', line 523 def is_not_regex_match(pattern) = Filter.new("is_not_regex_match(#{pattern.inspect})") |
#is_regex_match(pattern) ⇒ Object
Regex matching
522 |
# File 'lib/mq/query.rb', line 522 def is_regex_match(pattern) = Filter.new("is_regex_match(#{pattern.inspect})") |
#length ⇒ Object
String transforms usable in filter context
541 |
# File 'lib/mq/query.rb', line 541 def length = Filter.new("length") |
#lt(value) ⇒ Object
531 |
# File 'lib/mq/query.rb', line 531 def lt(value) = Filter.new("lt(#{value.inspect})") |
#lte(value) ⇒ Object
532 |
# File 'lib/mq/query.rb', line 532 def lte(value) = Filter.new("lte(#{value.inspect})") |
#ne(value) ⇒ Object
528 |
# File 'lib/mq/query.rb', line 528 def ne(value) = Filter.new("ne(#{value.inspect})") |
#negate(filter) ⇒ Object
Negate a filter expression with not(). Use negate instead of not since not is a Ruby keyword.
554 |
# File 'lib/mq/query.rb', line 554 def negate(filter) = Filter.new("not(#{filter})") |
#starts_with(text) ⇒ Object
517 |
# File 'lib/mq/query.rb', line 517 def starts_with(text) = Filter.new("starts_with(#{text.inspect})") |