Class: Dentaku::AST::String

Inherits:
Literal show all
Defined in:
lib/dentaku/ast/string.rb

Instance Attribute Summary

Attributes inherited from Literal

#type

Instance Method Summary collapse

Methods inherited from Literal

#accept, #dependencies, #initialize, #value

Methods inherited from Node

arity, #dependencies, #name, precedence, resolve_class, #type

Constructor Details

This class inherits a constructor from Dentaku::AST::Literal

Instance Method Details

#escapedObject



10
11
12
# File 'lib/dentaku/ast/string.rb', line 10

def escaped
  @value.gsub('"', '\"')
end

#quotedObject



6
7
8
# File 'lib/dentaku/ast/string.rb', line 6

def quoted
  %Q{"#{ escaped }"}
end