class BELParser::Parsers::AST::String

AST node representing a UTF-8 encoded string

Public Class Methods

new(children = [], properties = {}) click to toggle source

New String AST node.

@see Node#initialize Node class for basic properties

Calls superclass method BELParser::Parsers::AST::Node::new
# File lib/bel_parser/parsers/ast/node.rb, line 840
def initialize(children = [], properties = {})
  super(String.ast_type, children, properties)
end

Public Instance Methods

string_literal() click to toggle source

Get the string literal.

# File lib/bel_parser/parsers/ast/node.rb, line 845
def string_literal
  children[0]
end
string_value() click to toggle source
# File lib/bel_parser/parsers/ast/node.rb, line 849
def string_value
  return nil if children[0].nil?

  value = children[0].dup
  value.slice!(0)  if value[0]  == '"'
  value.slice!(-1) if value[-1] == '"'
  value
end