Module: Haml::More::AbstractHelper

Includes:
Helpers
Included in:
ContentFor, JavaScript::InstanceMethods
Defined in:
lib/haml/more.rb

Overview

Base class for all all Haml helper

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



27
28
29
30
# File 'lib/haml/more.rb', line 27

def self.included(klass)
  klass.extend ClassMethods
  super
end

Instance Method Details

#haml_helper(&block) ⇒ Object

Will make use of capture_haml depending on whether it is called from within Haml code or not. Thus helpers may be shared between Haml and others (like ERB), but still enjoy all the fancy Haml::Helpers tools.



37
38
39
40
# File 'lib/haml/more.rb', line 37

def haml_helper(&block)
  return capture_haml(&block) unless is_haml?
  yield
end