Class: H2o::Tags::Raw

Inherits:
Tag show all
Defined in:
lib/h2o/tags/raw.rb

Instance Method Summary collapse

Constructor Details

#initialize(parser, argstring) ⇒ Raw

Returns a new instance of Raw.



4
5
6
# File 'lib/h2o/tags/raw.rb', line 4

def initialize(parser, argstring)
  @body = parser.parse(:endraw)
end

Instance Method Details

#render(context, stream) ⇒ Object



8
9
10
11
12
# File 'lib/h2o/tags/raw.rb', line 8

def render(context, stream)
  raw_body = @body.parser.source.gsub(/\{%\s?(:?end)?raw\s?%\}/sm, '')
  
  stream << raw_body
end