Class: Markbridge::Parsers::BBCode::TextToken
- Defined in:
- lib/markbridge/parsers/bbcode/tokens/text_token.rb
Overview
Token representing text content
Instance Attribute Summary collapse
-
#text ⇒ Object
(also: #source)
readonly
Returns the value of attribute text.
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(text:, pos: 0) ⇒ TextToken
constructor
A new instance of TextToken.
- #inspect ⇒ Object
Constructor Details
#initialize(text:, pos: 0) ⇒ 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: 0) super(pos:, source: text) @text = text.freeze end |
Instance Attribute Details
#text ⇒ Object (readonly) Also known as: source
Returns the value of attribute text.
8 9 10 |
# File 'lib/markbridge/parsers/bbcode/tokens/text_token.rb', line 8 def text @text end |
Instance Method Details
#inspect ⇒ Object
17 18 19 |
# File 'lib/markbridge/parsers/bbcode/tokens/text_token.rb', line 17 def inspect "#<TextToken #{text.inspect}>" end |