Class: Sinatra::ContentFor2::HamlHandler

Inherits:
BaseHandler show all
Defined in:
lib/sinatra/content_for2/haml_handler.rb

Instance Attribute Summary

Attributes inherited from BaseHandler

#template

Instance Method Summary collapse

Methods inherited from BaseHandler

classes, #initialize, register

Constructor Details

This class inherits a constructor from Sinatra::ContentFor2::BaseHandler

Instance Method Details

#block_is_type?(block) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/sinatra/content_for2/haml_handler.rb', line 6

def block_is_type?(block)
  template.block_is_haml?(block)
end

#capture_from_template(*args, &block) ⇒ Object



10
11
12
13
# File 'lib/sinatra/content_for2/haml_handler.rb', line 10

def capture_from_template(*args, &block)
  eval("_hamlout ||= @haml_buffer", block.binding) # this is for rbx
  template.capture_haml(*args, &block)
end

#enginesObject



15
16
17
# File 'lib/sinatra/content_for2/haml_handler.rb', line 15

def engines
  @engines ||= [ :haml ]
end

#is_type?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/sinatra/content_for2/haml_handler.rb', line 2

def is_type?
  template.respond_to?(:is_haml?) && template.is_haml?
end