Method: Haml::Helpers#init_haml_helpers

Defined in:
lib/haml/helpers.rb

#init_haml_helpers

Note: this does not need to be called when using Haml helpers normally in Rails.

Initializes the current object as though it were in the same context as a normal ActionView instance using Haml. This is useful if you want to use the helpers in a context other than the normal setup with ActionView. For example:

context = Object.new
class << context
  include Haml::Helpers
end
context.init_haml_helpers
context.haml_tag :p, "Stuff"


76
77
78
79
# File 'lib/haml/helpers.rb', line 76

def init_haml_helpers
  @haml_buffer = Haml::Buffer.new(haml_buffer, Options.new.for_buffer)
  nil
end