class Sass::Tree::CommentNode

@see Sass::Tree
A static node representing a Sass comment (silent or loud).

def ==(other)

Returns:
  • (Boolean) - Whether or not this node and the other object

Parameters:
  • other (Object) -- The object to compare with
def ==(other)
  self.class == other.class && value == other.value && silent == other.silent && lines == other.lines
end

def _perform(environment)

Other tags:
    See: Sass::Tree -

Returns:
  • (Tree::Node, Array) - The resulting static nodes

Parameters:
  • environment (Sass::Environment) -- The lexical environment containing
def _perform(environment)
  return [] if @silent
  self
end

def initialize(value, silent)

Parameters:
  • silent (Boolean) -- See \{#silent}
  • value (String) -- See \{#value}
def initialize(value, silent)
  @lines = []
  @value = value[2..-1].strip
  @silent = silent
  super()
end

def invisible?

Returns:
  • (Boolean) -
def invisible?
  style == :compressed || @silent
end

def to_s(tabs = 0, _ = nil)

Other tags:
    See: #invisible? -

Returns:
  • (String, nil) - The resulting CSS

Parameters:
  • tabs (Fixnum) -- The level of indentation for the CSS

Overloads:
  • to_s(tabs = 0)
def to_s(tabs = 0, _ = nil)
  return if invisible?
  spaces = '  ' * (tabs - 1)
  content = (value.split("\n") + lines.map {|l| l.text})
  return spaces + "/* */" if content.empty?
  content.map! {|l| (l.empty? ? "" : " ") + l}
  content.first.gsub!(/^ /, '')
  content.last.gsub!(%r{ ?\*/ *$}, '')
  spaces + "/* " + content.join(style == :compact ? '' : "\n#{spaces} *") + " */"
end