Class: HamlProcessor
- Inherits:
-
Object
- Object
- HamlProcessor
- Defined in:
- lib/reveal-ck/haml_processor.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Returns the value of attribute html.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(haml) ⇒ HamlProcessor
constructor
A new instance of HamlProcessor.
Constructor Details
#initialize(haml) ⇒ HamlProcessor
Returns a new instance of HamlProcessor.
8 9 10 11 12 |
# File 'lib/reveal-ck/haml_processor.rb', line 8 def initialize(haml) render_context = ::OpenStruct.new({}) engine = ::Haml::Engine.new haml @html = engine.render render_context end |
Instance Attribute Details
#html ⇒ Object (readonly)
Returns the value of attribute html.
6 7 8 |
# File 'lib/reveal-ck/haml_processor.rb', line 6 def html @html end |
Class Method Details
.open(path) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/reveal-ck/haml_processor.rb', line 14 def self.open(path) haml_file = if File.exists? path path else File.(File.join(Dir.pwd, path)) end haml = File.open(haml_file).read HamlProcessor.new haml end |