Class: Haml::Ambles

Inherits:
Temple::Filter
  • Object
show all
Defined in:
lib/haml/ambles.rb

Instance Method Summary collapse

Constructor Details

#initializeAmbles

Returns a new instance of Ambles.



6
7
8
9
10
# File 'lib/haml/ambles.rb', line 6

def initialize(*)
  super
  @preamble = options[:preamble]
  @postamble = options[:postamble]
end

Instance Method Details

#call(ast)



12
13
14
15
16
17
18
# File 'lib/haml/ambles.rb', line 12

def call(ast)
  ret = [:multi]
  ret << [:static, @preamble] if @preamble
  ret << ast
  ret << [:static, @postamble] if @postamble
  ret
end