Class: Sass::Tree::CommentNode
- Defined in:
- lib/gems/haml-2.0.4/lib/sass/tree/comment_node.rb
Instance Attribute Summary
Attributes inherited from ValueNode
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(value, style) ⇒ CommentNode
constructor
A new instance of CommentNode.
- #to_s(tabs = 0, parent_name = nil) ⇒ Object
Methods inherited from ValueNode
Methods inherited from Node
Constructor Details
#initialize(value, style) ⇒ CommentNode
Returns a new instance of CommentNode.
5 6 7 |
# File 'lib/gems/haml-2.0.4/lib/sass/tree/comment_node.rb', line 5 def initialize(value, style) super(value[2..-1].strip, style) end |
Instance Method Details
#to_s(tabs = 0, parent_name = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/gems/haml-2.0.4/lib/sass/tree/comment_node.rb', line 9 def to_s(tabs = 0, parent_name = nil) return if @style == :compressed spaces = ' ' * (tabs - 1) join_string = @style == :compact ? ' ' : "\n#{spaces} * " str = "#{spaces}/* #{value}" str << join_string unless children.empty? str << "#{children.join join_string} */" str end |