Class: Janeway::AST::StringType
- Inherits:
-
Expression
- Object
- Expression
- Janeway::AST::StringType
- Defined in:
- lib/janeway/ast/string_type.rb
Overview
Represents a string literal within a filter expression. May be used within a comparison or a jsonpath function call.
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
-
#literal? ⇒ Boolean
Return true if this is a literal expression.
- #to_s ⇒ Object
Methods inherited from Expression
#indented, #initialize, #singular_query?, #tree, #type
Constructor Details
This class inherits a constructor from Janeway::AST::Expression
Instance Method Details
#literal? ⇒ Boolean
Return true if this is a literal expression
18 19 20 |
# File 'lib/janeway/ast/string_type.rb', line 18 def literal? true end |
#to_s ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/janeway/ast/string_type.rb', line 8 def to_s if @value.include?("'") %("#{@value}"') else "'#{@value}'" end end |