Class: Fortitude::Rails::TemplateHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/fortitude/rails/template_handler.rb

Instance Method Summary collapse

Instance Method Details

#call(template, &block) ⇒ Object


6
7
8
9
10
11
12
13
# File 'lib/fortitude/rails/template_handler.rb', line 6

def call(template, &block)
  widget_class_name = "views/#{template.identifier =~ %r(views/([^.]*)(\..*)?\.rb) && $1}".camelize
  is_partial = !! (File.basename(template.identifier) =~ /^_/)

  <<-SRC
  Fortitude::Rails::Renderer.render(#{widget_class_name}, self, local_assigns, #{is_partial.inspect}) { |*args| yield *args }
  SRC
end

#supports_streaming?Boolean

Returns:

  • (Boolean)

15
16
17
# File 'lib/fortitude/rails/template_handler.rb', line 15

def supports_streaming?
  true
end