Class: Sass::Tree::CommentNode
- Defined in:
- lib/sass/tree/comment_node.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value, options) ⇒ CommentNode
constructor
A new instance of CommentNode.
- #to_s(tabs = 0, parent_name = nil) ⇒ Object
Methods inherited from Node
#<<, #last, #perform, #to_sass
Constructor Details
#initialize(value, options) ⇒ CommentNode
Returns a new instance of CommentNode.
7 8 9 10 |
# File 'lib/sass/tree/comment_node.rb', line 7 def initialize(value, ) @value = value[2..-1].strip super() end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/sass/tree/comment_node.rb', line 5 def value @value end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 |
# File 'lib/sass/tree/comment_node.rb', line 12 def ==(other) self.value == other.value && super end |
#to_s(tabs = 0, parent_name = nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/sass/tree/comment_node.rb', line 16 def to_s(tabs = 0, parent_name = nil) return if @style == :compressed spaces = ' ' * (tabs - 1) spaces + "/* " + ([value] + children.map {|c| c.text}). join(@style == :compact ? ' ' : "\n#{spaces} * ") + " */" end |