Sha256: 34ef80e6d88d8cdadca1baeeceab5f58416e734561b85a88c0b764b8515fb71a

Contents?: true

Size: 616 Bytes

Versions: 1

Compression:

Stored size: 616 Bytes

Contents

require "musterb/version"
require "musterb/extract_values"
require "musterb/musterbifier"
require "musterb/binding_extractor"
require "musterb/hash_extractor"
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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
musterb-0.0.5 lib/musterb.rb