Class: BetterHtml::Tokenizer::BaseErb
- Inherits:
-
Erubi::Engine
- Object
- Erubi::Engine
- BetterHtml::Tokenizer::BaseErb
- Defined in:
- lib/better_html/tokenizer/base_erb.rb
Direct Known Subclasses
Constant Summary collapse
- REGEXP_WITHOUT_TRIM =
/<%(={1,2}|%)?(.*?)()?%>([ \t]*\r?\n)?/m- STMT_TRIM_MATCHER =
/\A(-|#)?(.*?)([-=])?\z/m- EXPR_TRIM_MATCHER =
/\A(.*?)(-)?\z/m
Instance Attribute Summary collapse
-
#current_position ⇒ Object
readonly
Returns the value of attribute current_position.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#initialize(document) ⇒ BaseErb
constructor
A new instance of BaseErb.
Constructor Details
#initialize(document) ⇒ BaseErb
Returns a new instance of BaseErb.
15 16 17 18 19 20 |
# File 'lib/better_html/tokenizer/base_erb.rb', line 15 def initialize(document) @document = document @tokens = [] @current_position = 0 super(document, regexp: REGEXP_WITHOUT_TRIM, trim: false) end |
Instance Attribute Details
#current_position ⇒ Object (readonly)
Returns the value of attribute current_position.
13 14 15 |
# File 'lib/better_html/tokenizer/base_erb.rb', line 13 def current_position @current_position end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
12 13 14 |
# File 'lib/better_html/tokenizer/base_erb.rb', line 12 def tokens @tokens end |