Class: MiniHTML::AST::String

Inherits:
Base
  • Object
show all
Defined in:
lib/minihtml/ast/string.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#original_token, #position_end, #position_start

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ String



8
9
10
11
12
# File 'lib/minihtml/ast/string.rb', line 8

def initialize(token)
  super
  @literal = token[:literal].gsub(/\\#{token[:quote_char]}/, token[:quote_char])
  @quote = token[:quote_char]
end

Instance Attribute Details

#literalObject

Returns the value of attribute literal.



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

def literal
  @literal
end

#quoteObject

Returns the value of attribute quote.



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

def quote
  @quote
end