Class: I18nliner::PreProcessors::ErbPreProcessor::Context
- Inherits:
-
Object
- Object
- I18nliner::PreProcessors::ErbPreProcessor::Context
- Defined in:
- lib/i18nliner/pre_processors/erb_pre_processor.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #<<(string) ⇒ Object
-
#initialize(parent = nil) ⇒ Context
constructor
A new instance of Context.
- #result ⇒ Object
Constructor Details
#initialize(parent = nil) ⇒ Context
Returns a new instance of Context.
15 16 17 18 |
# File 'lib/i18nliner/pre_processors/erb_pre_processor.rb', line 15 def initialize(parent = nil) @parent = parent @buffer = '' end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
13 14 15 |
# File 'lib/i18nliner/pre_processors/erb_pre_processor.rb', line 13 def buffer @buffer end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
13 14 15 |
# File 'lib/i18nliner/pre_processors/erb_pre_processor.rb', line 13 def parent @parent end |
Instance Method Details
#<<(string) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/i18nliner/pre_processors/erb_pre_processor.rb', line 20 def <<(string) if string =~ ERB_T_BLOCK_EXPRESSION TBlock.new(self, $&) else @buffer << string self end end |
#result ⇒ Object
29 30 31 |
# File 'lib/i18nliner/pre_processors/erb_pre_processor.rb', line 29 def result @buffer end |