class DDQL::TokenType::Literal

Literals

Public Class Methods

new(name:, pattern:) click to toggle source
Calls superclass method DDQL::TokenType::new
# File lib/ddql/token_type.rb, line 109
def initialize(name:, pattern:)
  super(name: name, pattern: pattern)
  trimming!
end

Public Instance Methods

as_hash(data) click to toggle source
# File lib/ddql/token_type.rb, line 114
def as_hash(data)
  {data_type => data}
end
data_type() click to toggle source
# File lib/ddql/token_type.rb, line 118
def data_type
  raise "subclass responsibility for [#{self.class}]"
end
literal?() click to toggle source
# File lib/ddql/token_type.rb, line 122
def literal?
  true
end