Class: Janeway::AST::StringType

Inherits:
Expression show all
Defined in:
lib/janeway/ast/string_type.rb

Instance Attribute Summary

Attributes inherited from Expression

#value

Instance Method Summary collapse

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

Returns:



16
17
18
# File 'lib/janeway/ast/string_type.rb', line 16

def literal?
  true
end

#to_sObject



6
7
8
9
10
11
12
# File 'lib/janeway/ast/string_type.rb', line 6

def to_s
  if @value.include?("'")
    %("#{@value}"')
  else
    "'#{@value}'"
  end
end