Parent

Files

Padrino::Helpers::OutputHelpers::HamlHandler

Handler for reading and writing from a haml template.

Public Instance Methods

block_is_type?(block) click to toggle source

Returns true if the block given is of the handler’s template type; false otherwise.

@example

@handler.block_is_type?(block) => true
# File lib/padrino-helpers/output_helpers/haml_handler.rb, line 24
def block_is_type?(block)
  template.block_is_haml?(block)
end
capture_from_template(*args, &block) click to toggle source

Captures the html from a block of template code for this handler

@example

@handler.capture_from_template(&block) => "...html..."
# File lib/padrino-helpers/output_helpers/haml_handler.rb, line 33
def capture_from_template(*args, &block)
  eval("_hamlout ||= @haml_buffer", block.binding) # this is for rbx
  template.capture_haml(*args, &block)
end
concat_to_template(text="") click to toggle source

Outputs the given text to the templates buffer directly

@example

@handler.concat_to_template("This will be output to the template buffer")
# File lib/padrino-helpers/output_helpers/haml_handler.rb, line 44
def concat_to_template(text="")
  template.haml_concat(text)
  nil
end
engines() click to toggle source

Returns an array of engines used for the template

@example

@handler.engines => [:haml]
# File lib/padrino-helpers/output_helpers/haml_handler.rb, line 55
def engines
  @_engines ||= [:haml]
end
is_type?() click to toggle source

Returns true if the current template type is same as this handlers; false otherwise.

@example

@handler.is_type? => true
# File lib/padrino-helpers/output_helpers/haml_handler.rb, line 14
def is_type?
  template.respond_to?(:is_haml?) && template.is_haml?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.