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.
6 7 8 9 |
# File 'lib/better_html/tokenizer/token.rb', line 6 def initialize(type:, loc:) @type = type @loc = loc end |
Instance Attribute Details
#loc ⇒ Object (readonly)
Returns the value of attribute loc.
4 5 6 |
# File 'lib/better_html/tokenizer/token.rb', line 4 def loc @loc end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/better_html/tokenizer/token.rb', line 4 def type @type end |
Instance Method Details
#inspect ⇒ Object
11 12 13 |
# File 'lib/better_html/tokenizer/token.rb', line 11 def inspect "t(#{type.inspect}, #{loc&.source.inspect})" end |