Class: Synvert::Core::Engine::ERB
- Inherits:
-
Object
- Object
- Synvert::Core::Engine::ERB
- Defined in:
- lib/synvert/core/engine/erb.rb
Class Method Summary collapse
-
.decode(source) ⇒ String
convert ruby code to erb.
-
.encode(source) ⇒ String
convert erb to ruby code.
Class Method Details
.decode(source) ⇒ String
convert ruby code to erb.
23 24 25 26 27 28 |
# File 'lib/synvert/core/engine/erb.rb', line 23 def decode(source) source = decode_ruby_stmt(source) source = decode_ruby_output(source) source = decode_html_output(source) source = remove_erubis_buf(source) end |
.encode(source) ⇒ String
convert erb to ruby code.
15 16 17 |
# File 'lib/synvert/core/engine/erb.rb', line 15 def encode(source) Erubis.new(source.gsub("-%>", "%>"), :escape => false, :trim => false).src end |