Class: Haml::Filters

Inherits:
Object
  • Object
show all
Defined in:
lib/haml/filters.rb,
lib/haml/filters/css.rb,
lib/haml/filters/erb.rb,
lib/haml/filters/base.rb,
lib/haml/filters/less.rb,
lib/haml/filters/ruby.rb,
lib/haml/filters/sass.rb,
lib/haml/filters/scss.rb,
lib/haml/filters/cdata.rb,
lib/haml/filters/plain.rb,
lib/haml/filters/coffee.rb,
lib/haml/filters/escaped.rb,
lib/haml/filters/markdown.rb,
lib/haml/filters/preserve.rb,
lib/haml/filters/text_base.rb,
lib/haml/filters/tilt_base.rb,
lib/haml/filters/javascript.rb

Defined Under Namespace

Classes: Base, Cdata, Coffee, Css, Erb, Escaped, Javascript, Less, Markdown, Plain, Preserve, Ruby, Sass, Scss, TextBase, TiltBase

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Filters

Returns a new instance of Filters.



55
56
57
58
# File 'lib/haml/filters.rb', line 55

def initialize(options = {})
  @options = options
  @compilers = {}
end

Class Attribute Details

.registered (readonly)

Returns the value of attribute registered.



24
25
26
# File 'lib/haml/filters.rb', line 24

def registered
  @registered
end

Class Method Details

.remove_filter(name)



26
27
28
29
30
31
# File 'lib/haml/filters.rb', line 26

def remove_filter(name)
  registered.delete(name.to_s.downcase.to_sym)
  if constants.map(&:to_s).include?(name.to_s)
    remove_const name.to_sym
  end
end

Instance Method Details

#compile(node)



60
61
62
63
# File 'lib/haml/filters.rb', line 60

def compile(node)
  node.value[:text] ||= ''
  find_compiler(node).compile(node)
end