Class: Hamloft::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/hamloft/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(haml, html) ⇒ Template

Returns a new instance of Template.



5
6
7
8
9
# File 'lib/hamloft/template.rb', line 5

def initialize(haml, html)
  self.haml = haml
  self.html = html
  self.doc = Nokogiri::HTML.fragment(self.html)
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



3
4
5
# File 'lib/hamloft/template.rb', line 3

def doc
  @doc
end

#hamlObject

Returns the value of attribute haml.



3
4
5
# File 'lib/hamloft/template.rb', line 3

def haml
  @haml
end

#htmlObject

Returns the value of attribute html.



3
4
5
# File 'lib/hamloft/template.rb', line 3

def html
  @html
end

Instance Method Details

#chunksObject



11
12
13
# File 'lib/hamloft/template.rb', line 11

def chunks
  []
end

#container {|block| ... } ⇒ Object

Yields:

  • (block)


15
16
17
# File 'lib/hamloft/template.rb', line 15

def container(&block)
  yield(block)
end

#process_chunk(_chunk) ⇒ Object



19
20
21
# File 'lib/hamloft/template.rb', line 19

def process_chunk(_chunk)
  nil
end