Class: MiniHTML::AST::Base
- Inherits:
-
Object
- Object
- MiniHTML::AST::Base
- Defined in:
- lib/minihtml/ast/base.rb
Direct Known Subclasses
Attr, Comment, Executable, Interpolation, Literal, PlainText, String, Tag
Instance Attribute Summary collapse
-
#original_token ⇒ Object
readonly
Returns the value of attribute original_token.
-
#position_end ⇒ Object
readonly
Returns the value of attribute position_end.
-
#position_start ⇒ Object
readonly
Returns the value of attribute position_start.
Instance Method Summary collapse
-
#initialize(token) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(token) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 |
# File 'lib/minihtml/ast/base.rb', line 8 def initialize(token) @original_token = token @position_start = Position.new(line: token[:start_line], column: token[:start_column], offset: token[:start_offset]) @position_end = Position.new(line: token[:end_line], column: token[:end_column], offset: token[:end_offset]) end |
Instance Attribute Details
#original_token ⇒ Object (readonly)
Returns the value of attribute original_token.
6 7 8 |
# File 'lib/minihtml/ast/base.rb', line 6 def original_token @original_token end |
#position_end ⇒ Object (readonly)
Returns the value of attribute position_end.
6 7 8 |
# File 'lib/minihtml/ast/base.rb', line 6 def position_end @position_end end |
#position_start ⇒ Object (readonly)
Returns the value of attribute position_start.
6 7 8 |
# File 'lib/minihtml/ast/base.rb', line 6 def position_start @position_start end |