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
580 |
# File 'lib/mq/query.rb', line 580 def add(other) = Filter.new("add(#{other.inspect})") |
#contains(text) ⇒ Object
String matching
551 |
# File 'lib/mq/query.rb', line 551 def contains(text) = Filter.new("contains(#{text.inspect})") |
#ends_with(text) ⇒ Object
553 |
# File 'lib/mq/query.rb', line 553 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.
562 |
# File 'lib/mq/query.rb', line 562 def eq(value) = Filter.new("eq(#{value.inspect})") |
#gt(value) ⇒ Object
564 |
# File 'lib/mq/query.rb', line 564 def gt(value) = Filter.new("gt(#{value.inspect})") |
#gte(value) ⇒ Object
565 |
# File 'lib/mq/query.rb', line 565 def gte(value) = Filter.new("gte(#{value.inspect})") |
#is_mdx ⇒ Object
Type checks
570 |
# File 'lib/mq/query.rb', line 570 def is_mdx = Filter.new("is_mdx()") |
#is_not_regex_match(pattern) ⇒ Object
558 |
# File 'lib/mq/query.rb', line 558 def is_not_regex_match(pattern) = Filter.new("is_not_regex_match(#{pattern.inspect})") |
#is_regex_match(pattern) ⇒ Object
Regex matching
557 |
# File 'lib/mq/query.rb', line 557 def is_regex_match(pattern) = Filter.new("is_regex_match(#{pattern.inspect})") |
#length ⇒ Object
String transforms usable in filter context
576 |
# File 'lib/mq/query.rb', line 576 def length = Filter.new("len()") |
#lt(value) ⇒ Object
566 |
# File 'lib/mq/query.rb', line 566 def lt(value) = Filter.new("lt(#{value.inspect})") |
#lte(value) ⇒ Object
567 |
# File 'lib/mq/query.rb', line 567 def lte(value) = Filter.new("lte(#{value.inspect})") |
#ne(value) ⇒ Object
563 |
# File 'lib/mq/query.rb', line 563 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.
588 |
# File 'lib/mq/query.rb', line 588 def negate(filter) = Filter.new("not(#{filter})") |
#starts_with(text) ⇒ Object
552 |
# File 'lib/mq/query.rb', line 552 def starts_with(text) = Filter.new("starts_with(#{text.inspect})") |