Module: TemplateInheritance::TiltExtensions::Haml

Defined in:
lib/template-inheritance/exts/tilt.rb

Overview

Tilt::HamlTemplate.options = {type: “text/javascript”, form: “POST”}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



9
10
11
12
13
14
# File 'lib/template-inheritance/exts/tilt.rb', line 9

def self.included(klass)
  klass.send(:remove_method, :initialize_engine)
  def klass.options
    @options ||= Hash.new
  end
end

Instance Method Details

#initialize(*args) ⇒ Object



21
22
23
24
# File 'lib/template-inheritance/exts/tilt.rb', line 21

def initialize(*args)
  super
  self.options.merge!(self.class.options)
end

#initialize_engineObject



16
17
18
19
# File 'lib/template-inheritance/exts/tilt.rb', line 16

def initialize_engine
  require_template_library 'haml' unless defined? ::Haml::Engine
  require "template-inheritance/exts/haml" if self.class.options[:default_attributes]
end