Class: Sass::Tree::CommentNode
- Inherits:
-
Node
show all
- Defined in:
- lib/sass/tree/comment_node.rb
Instance Attribute Summary collapse
Attributes inherited from Node
#children, #filename, #line
Instance Method Summary
collapse
Methods inherited from Node
#<<, #last, #perform, #to_sass
Constructor Details
#initialize(value, options) ⇒ CommentNode
7
8
9
10
|
# File 'lib/sass/tree/comment_node.rb', line 7
def initialize(value, options)
@value = value[2..-1].strip
super(options)
end
|
Instance Attribute Details
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
|
#silent? ⇒ Boolean
16
17
18
|
# File 'lib/sass/tree/comment_node.rb', line 16
def silent?
!!@options[:silent]
end
|
#to_s(tabs = 0, parent_name = nil) ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/sass/tree/comment_node.rb', line 20
def to_s(tabs = 0, parent_name = nil)
return if (@style == :compressed || silent?)
spaces = ' ' * (tabs - 1)
spaces + "/* " + ([value] + children.map {|c| c.text}).
map{|l| l.sub(%r{ ?\*/ *$},'')}.join(@style == :compact ? ' ' : "\n#{spaces} * ") + " */"
end
|