Class: Garterbelt::Comment

Inherits:
Text show all
Defined in:
lib/renderers/comment.rb

Instance Attribute Summary

Attributes inherited from Text

#content

Attributes inherited from Renderer

#escape, #style, #view

Instance Method Summary collapse

Methods inherited from Text

#escaped_content, #line_end, #raise_with_block_content

Methods inherited from Renderer

#indent, #level, #line_end, #output, #output=

Constructor Details

#initialize(opts) ⇒ Comment

Returns a new instance of Comment.



3
4
5
# File 'lib/renderers/comment.rb', line 3

def initialize(opts)
  super
end

Instance Method Details

#renderObject



11
12
13
14
# File 'lib/renderers/comment.rb', line 11

def render
  raise_with_block_content
  output << template
end

#templateObject



7
8
9
# File 'lib/renderers/comment.rb', line 7

def template
  style == :text ? "" : "#{indent}<!-- #{content} -->#{line_end}"
end