Sha256: c688fc86653cf1e68bf562df6f7d50b498f3b10680318718ef8603d07f2602fe

Contents?: true

Size: 697 Bytes

Versions: 106

Compression:

Stored size: 697 Bytes

Contents

module Temple
  module Mixins
    # @api private
    module Template
      include ClassOptions

      def compile(code, options)
        engine = options.delete(:engine)
        raise 'No engine configured' unless engine
        engine.new(options).call(code)
      end

      def register_as(*names)
        raise NotImplementedError
      end

      def create(engine, options)
        register_as = options.delete(:register_as)
        template = Class.new(self)
        template.disable_option_validator!
        template.options[:engine] = engine
        template.options.update(options)
        template.register_as(*register_as) if register_as
        template
      end
    end
  end
end

Version data entries

106 entries across 92 versions & 7 rubygems

Version Path
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
brakeman-4.6.1 bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
brakeman-4.6.0 bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
brakeman-4.5.1 bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
brakeman-4.5.0 bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/mixins/template.rb
temple-0.8.1 lib/temple/mixins/template.rb
brakeman-4.4.0 bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/mixins/template.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/mixins/template.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/mixins/template.rb