lib/musterb.rb in musterb-0.0.4 vs lib/musterb.rb in musterb-0.0.5
- old
+ new
@@ -6,11 +6,17 @@
require "musterb/object_extractor"
require "musterb/null_extractor"
require "musterb/evaluator"
require "musterb/chain"
+require "erubis"
+
module Musterb
def self.to_erb(template)
musterbifier = Musterbifier.new(template)
"<% Musterb::Evaluator.new(Musterb::BindingExtractor.new binding).tap do |musterb| %>#{musterbifier.to_erb}<% end %>"
+ end
+
+ def self.render(template, values)
+ Erubis::Eruby.new(to_erb template).result(values)
end
end