Class: HamlUserTags::Engine
- Inherits:
-
Haml::Engine
- Object
- Haml::Engine
- HamlUserTags::Engine
- Defined in:
- lib/haml_user_tags/engine.rb
Instance Method Summary collapse
-
#extend_object(obj) ⇒ Object
Defines a method for each user tag in the template that renders the tag and returns the result as a string.
-
#initialize(template, options = {}) ⇒ Engine
constructor
A new instance of Engine.
Constructor Details
#initialize(template, options = {}) ⇒ Engine
Returns a new instance of Engine.
3 4 5 6 |
# File 'lib/haml_user_tags/engine.rb', line 3 def initialize(template, = {}) = .clone.update(:compiler_class => HamlUserTags::Compiler) super template, end |
Instance Method Details
#extend_object(obj) ⇒ Object
Defines a method for each user tag in the template that renders the tag and returns the result as a string.
10 11 12 13 14 15 16 |
# File 'lib/haml_user_tags/engine.rb', line 10 def extend_object obj mod = Module.new mod.send :include, Haml::Helpers render mod method = obj.is_a?(Module) ? :include : :extend obj.send method, mod end |