Class: Erubis::TinyEruby

Class | Erubis::TinyEruby
In: | lib/erubis/tiny.rb
Parent: | Object

tiny and the simplest implementation of eRuby

ex.

      eruby = TinyEruby.new(File.read('example.rhtml'))
      print eruby.src                 # print ruby code
      print eruby.result(binding())   # eval ruby code with Binding object
      print eruby.evalute(context)    # eval ruby code with context object

### Methods

convert evaluate new result

### Constants

EMBEDDED_PATTERN | = | /<%(=+|\#)?(.*?)-?%>/m

### Attributes

src | [R] |

### Public Class methods

new(input=nil)

### Public Instance methods

convert(input)
evaluate(_context=Object.new)
result(_binding=TOPLEVEL_BINDING)

def escape_text(text)

      return text.gsub!(/['\\]/, '\\\\\&') || text

end

[Validate]