Class: Serenity::OdtEruby
- Inherits:
-
Object
- Object
- Serenity::OdtEruby
- Includes:
- Debug
- Defined in:
- lib/serenity/serenity/odteruby.rb
Constant Summary collapse
- EMBEDDED_PATTERN =
/\{%([=%]+)?(.*?)-?%\}/m
Instance Method Summary collapse
- #evaluate(context) ⇒ Object
-
#initialize(template) ⇒ OdtEruby
constructor
A new instance of OdtEruby.
Methods included from Debug
#debug?, #debug_dir, #debug_file_name, #debug_file_path
Constructor Details
#initialize(template) ⇒ OdtEruby
Returns a new instance of OdtEruby.
7 8 9 10 11 12 13 14 |
# File 'lib/serenity/serenity/odteruby.rb', line 7 def initialize template @src = convert template if debug? File.open(debug_file_path, 'w') do |f| f << @src end end end |
Instance Method Details
#evaluate(context) ⇒ Object
16 17 18 |
# File 'lib/serenity/serenity/odteruby.rb', line 16 def evaluate context eval(@src, context) end |