Class: Markbridge::Parsers::BBCode::TextToken

Inherits:
Token
  • Object
show all
Defined in:
lib/markbridge/parsers/bbcode/tokens/text_token.rb

Overview

Token representing text content

Instance Attribute Summary collapse

Attributes inherited from Token

#pos, #source

Instance Method Summary collapse

Constructor Details

#initialize(text:, pos:) ⇒ TextToken

Returns a new instance of TextToken.



10
11
12
13
# File 'lib/markbridge/parsers/bbcode/tokens/text_token.rb', line 10

def initialize(text:, pos:)
  super(pos:, source: text)
  @text = text.freeze
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



8
9
10
# File 'lib/markbridge/parsers/bbcode/tokens/text_token.rb', line 8

def text
  @text
end