class Sass::Tree::CommentNode
@see Sass::Tree
A static node representing a Sass comment (silent or loud).
def ==(other)
-
(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 end
def initialize(value, silent)
-
silent
(Boolean
) -- See \{#silent} -
value
(String
) -- See \{#value}
def initialize(value, silent) @lines = [] @value = normalize_indentation value @silent = silent super() end
def invisible?
-
(Boolean)
-
def invisible? style == :compressed || @silent end
def normalize_indentation(str)
def normalize_indentation(str) pre = str.split("\n").inject(str[/^[ \t]*/].split("")) do |pre, line| line[/^[ \t]*/].split("").zip(pre).inject([]) do |arr, (a, b)| break arr if a != b arr + [a] end end.join str.gsub(/^#{pre}/, '') end