Class: Cel::String
- Defined in:
- lib/cel/ast/elements.rb
Instance Attribute Summary
Attributes inherited from Literal
Instance Method Summary collapse
-
#contains(string) ⇒ Object
CEL string functions.
- #endsWith(string) ⇒ Object
-
#initialize(value) ⇒ String
constructor
A new instance of String.
- #matches(pattern) ⇒ Object
- #startsWith(string) ⇒ Object
Methods inherited from Literal
#==, to_cel_type, #to_ruby_type
Constructor Details
#initialize(value) ⇒ String
Returns a new instance of String.
243 244 245 |
# File 'lib/cel/ast/elements.rb', line 243 def initialize(value) super(:string, value) end |
Instance Method Details
#contains(string) ⇒ Object
CEL string functions
249 250 251 |
# File 'lib/cel/ast/elements.rb', line 249 def contains(string) Bool.new(@value.include?(string)) end |
#endsWith(string) ⇒ Object
253 254 255 |
# File 'lib/cel/ast/elements.rb', line 253 def endsWith(string) Bool.new(@value.end_with?(string)) end |