Class: AxHub::Data::LikeBuilder
- Inherits:
-
Object
- Object
- AxHub::Data::LikeBuilder
- Defined in:
- lib/axhub_sdk/data/dsl/ops.rb
Instance Method Summary collapse
- #contains(value) ⇒ Object
- #ends_with(value) ⇒ Object
-
#initialize(name) ⇒ LikeBuilder
constructor
A new instance of LikeBuilder.
- #raw(value) ⇒ Object
- #starts_with(value) ⇒ Object
Constructor Details
#initialize(name) ⇒ LikeBuilder
Returns a new instance of LikeBuilder.
102 103 104 |
# File 'lib/axhub_sdk/data/dsl/ops.rb', line 102 def initialize(name) @name = name end |
Instance Method Details
#contains(value) ⇒ Object
106 107 108 |
# File 'lib/axhub_sdk/data/dsl/ops.rb', line 106 def contains(value) { op: :like, column: @name, value: "%#{Data.escape_like(value)}%" } end |
#ends_with(value) ⇒ Object
114 115 116 |
# File 'lib/axhub_sdk/data/dsl/ops.rb', line 114 def ends_with(value) { op: :like, column: @name, value: "%#{Data.escape_like(value)}" } end |
#raw(value) ⇒ Object
118 119 120 121 |
# File 'lib/axhub_sdk/data/dsl/ops.rb', line 118 def raw(value) Data.assert_safe_like_pattern(value) { op: :like, column: @name, value: value } end |
#starts_with(value) ⇒ Object
110 111 112 |
# File 'lib/axhub_sdk/data/dsl/ops.rb', line 110 def starts_with(value) { op: :like, column: @name, value: "#{Data.escape_like(value)}%" } end |