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(other) ⇒ 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
#add(other) ⇒ Object
547 |
# File 'lib/mq/query.rb', line 547 def add(other) = Filter.new("add(#{other.inspect})") |
#contains(text) ⇒ Object
String matching
518 |
# File 'lib/mq/query.rb', line 518 def contains(text) = Filter.new("contains(#{text.inspect})") |
#ends_with(text) ⇒ Object
520 |
# File 'lib/mq/query.rb', line 520 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.
529 |
# File 'lib/mq/query.rb', line 529 def eq(value) = Filter.new("eq(#{value.inspect})") |
#gt(value) ⇒ Object
531 |
# File 'lib/mq/query.rb', line 531 def gt(value) = Filter.new("gt(#{value.inspect})") |
#gte(value) ⇒ Object
532 |
# File 'lib/mq/query.rb', line 532 def gte(value) = Filter.new("gte(#{value.inspect})") |
#is_mdx ⇒ Object
Type checks
537 |
# File 'lib/mq/query.rb', line 537 def is_mdx = Filter.new("is_mdx()") |
#is_not_regex_match(pattern) ⇒ Object
525 |
# File 'lib/mq/query.rb', line 525 def is_not_regex_match(pattern) = Filter.new("is_not_regex_match(#{pattern.inspect})") |
#is_regex_match(pattern) ⇒ Object
Regex matching
524 |
# File 'lib/mq/query.rb', line 524 def is_regex_match(pattern) = Filter.new("is_regex_match(#{pattern.inspect})") |
#length ⇒ Object
String transforms usable in filter context
543 |
# File 'lib/mq/query.rb', line 543 def length = Filter.new("len()") |
#lt(value) ⇒ Object
533 |
# File 'lib/mq/query.rb', line 533 def lt(value) = Filter.new("lt(#{value.inspect})") |
#lte(value) ⇒ Object
534 |
# File 'lib/mq/query.rb', line 534 def lte(value) = Filter.new("lte(#{value.inspect})") |
#ne(value) ⇒ Object
530 |
# File 'lib/mq/query.rb', line 530 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.
555 |
# File 'lib/mq/query.rb', line 555 def negate(filter) = Filter.new("not(#{filter})") |
#starts_with(text) ⇒ Object
519 |
# File 'lib/mq/query.rb', line 519 def starts_with(text) = Filter.new("starts_with(#{text.inspect})") |