Module: Hamloft
- Defined in:
- lib/hamloft.rb,
lib/hamloft/engine.rb,
lib/hamloft/widget.rb,
lib/hamloft/helpers.rb,
lib/hamloft/options.rb,
lib/hamloft/version.rb,
lib/hamloft/template.rb,
lib/hamloft/style_builder.rb
Defined Under Namespace
Modules: Helpers
Classes: Engine, Options, StyleBuilder, Template, Widget
Constant Summary
collapse
- VERSION =
"0.2.1"
- @@_templates =
{}
- @@_widgets =
[]
Class Method Summary
collapse
Class Method Details
.register_template(key, template) ⇒ Object
19
20
21
|
# File 'lib/hamloft.rb', line 19
def self.register_template(key, template)
@@_templates[key] = template
end
|
23
24
25
|
# File 'lib/hamloft.rb', line 23
def self.register_widget(klass)
@@_widgets.push(klass)
end
|
.render(haml, variables = {}) ⇒ Object
15
16
17
|
# File 'lib/hamloft.rb', line 15
def self.render(haml, variables={})
Hamloft::Engine.new(haml, remove_whitespace: true).render(Object.new, variables)
end
|
.template(key) ⇒ Object
31
32
33
|
# File 'lib/hamloft.rb', line 31
def self.template(key)
@@_templates[key]
end
|
27
28
29
|
# File 'lib/hamloft.rb', line 27
def self.widgets
@@_widgets
end
|