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
644 |
# File 'lib/mq/query.rb', line 644 def add(other) = Filter.new("add(#{other.inspect})") |
#contains(text) ⇒ Object
String matching
615 |
# File 'lib/mq/query.rb', line 615 def contains(text) = Filter.new("contains(#{text.inspect})") |
#ends_with(text) ⇒ Object
617 |
# File 'lib/mq/query.rb', line 617 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.
626 |
# File 'lib/mq/query.rb', line 626 def eq(value) = Filter.new("eq(#{value.inspect})") |
#gt(value) ⇒ Object
628 |
# File 'lib/mq/query.rb', line 628 def gt(value) = Filter.new("gt(#{value.inspect})") |
#gte(value) ⇒ Object
629 |
# File 'lib/mq/query.rb', line 629 def gte(value) = Filter.new("gte(#{value.inspect})") |
#is_mdx ⇒ Object
Type checks
634 |
# File 'lib/mq/query.rb', line 634 def is_mdx = Filter.new("is_mdx()") |
#is_not_regex_match(pattern) ⇒ Object
622 |
# File 'lib/mq/query.rb', line 622 def is_not_regex_match(pattern) = Filter.new("is_not_regex_match(#{pattern.inspect})") |
#is_regex_match(pattern) ⇒ Object
Regex matching
621 |
# File 'lib/mq/query.rb', line 621 def is_regex_match(pattern) = Filter.new("is_regex_match(#{pattern.inspect})") |
#length ⇒ Object
String transforms usable in filter context
640 |
# File 'lib/mq/query.rb', line 640 def length = Filter.new("len()") |
#lt(value) ⇒ Object
630 |
# File 'lib/mq/query.rb', line 630 def lt(value) = Filter.new("lt(#{value.inspect})") |
#lte(value) ⇒ Object
631 |
# File 'lib/mq/query.rb', line 631 def lte(value) = Filter.new("lte(#{value.inspect})") |
#ne(value) ⇒ Object
627 |
# File 'lib/mq/query.rb', line 627 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.
652 |
# File 'lib/mq/query.rb', line 652 def negate(filter) = Filter.new("not(#{filter})") |
#starts_with(text) ⇒ Object
616 |
# File 'lib/mq/query.rb', line 616 def starts_with(text) = Filter.new("starts_with(#{text.inspect})") |