Class: BetterHtml::Tokenizer::Token
- Inherits:
-
Object
- Object
- BetterHtml::Tokenizer::Token
- Defined in:
- lib/better_html/tokenizer/token.rb
Instance Attribute Summary collapse
-
#loc ⇒ Object
readonly
Returns the value of attribute loc.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, loc:) ⇒ Token
constructor
A new instance of Token.
- #inspect ⇒ Object
Constructor Details
#initialize(type:, loc:) ⇒ Token
Returns a new instance of Token.
8 9 10 11 |
# File 'lib/better_html/tokenizer/token.rb', line 8 def initialize(type:, loc:) @type = type @loc = loc end |
Instance Attribute Details
#loc ⇒ Object (readonly)
Returns the value of attribute loc.
6 7 8 |
# File 'lib/better_html/tokenizer/token.rb', line 6 def loc @loc end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/better_html/tokenizer/token.rb', line 6 def type @type end |
Instance Method Details
#inspect ⇒ Object
13 14 15 |
# File 'lib/better_html/tokenizer/token.rb', line 13 def inspect "t(#{type.inspect}, #{loc&.source.inspect})" end |