Class: Raw::HTMLFormat

Inherits:
Format
  • Object
show all
Defined in:
lib/raw/dispatcher/format/html.rb

Instance Attribute Summary

Attributes inherited from Format

#content_type, #extension, #name, #template_extension

Instance Method Summary collapse

Methods inherited from Format

#after_action, #before_action, #to_s

Constructor Details

#initializeHTMLFormat

Returns a new instance of HTMLFormat.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/raw/dispatcher/format/html.rb', line 14

def initialize
  @name = "html"
  @content_type = "text/html"
  @extension = "html"
  @template_extension = "htmlx"
  @template_filters = [
    StaticIncludeFilter.new, 
    ElementsFilter.new,
    MorphFilter.new,
    CleanupFilter.new,
    MarkupFilter.new,
#     SqueezeFilter.new,
    TemplateFilter.new
  ]
end

Instance Method Details

#filter_template(source) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/raw/dispatcher/format/html.rb', line 30

def filter_template(source)
  return if source.blank?
  
  for filter in @template_filters
    source = filter.apply(source)
  end
  
  return source
end