Class: Markbridge::Parsers::BBCode::TagStartToken

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

Overview

Token representing an opening BBCode tag like [b] or [url=...]

Instance Attribute Summary collapse

Attributes inherited from Token

#pos, #source

Instance Method Summary collapse

Constructor Details

#initialize(tag:, attrs:, pos:, source:) ⇒ TagStartToken

Returns a new instance of TagStartToken.



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

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

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



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

def attrs
  @attrs
end

#tagObject (readonly)

Returns the value of attribute tag.



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

def tag
  @tag
end