Class: Hamlit::Filters

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

Defined Under Namespace

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

Constant Summary collapse

CoffeeScript =
Coffee

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/hamlit/filters.rb', line 55

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

Class Attribute Details

.registeredObject (readonly)

Returns the value of attribute registered


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

def registered
  @registered
end

Class Method Details

.remove_filter(name) ⇒ Object


26
27
28
29
30
31
# File 'lib/hamlit/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) ⇒ Object


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

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