Class: CSSPool::Node
- Inherits:
-
Object
show all
- Includes:
- Enumerable
- Defined in:
- lib/csspool/node.rb
Direct Known Subclasses
CSS::Charset, CSS::Declaration, CSS::Document, CSS::ImportRule, CSS::Media, CSS::RuleSet, Selector, Selectors::Additional, Selectors::Simple, Terms::Function, Terms::Ident, Terms::Rgb
Instance Method Summary
collapse
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
22
23
24
25
26
|
# File 'lib/csspool/node.rb', line 22
def == other
return false unless self.class == other.class
accept Visitors::Comparable.new other
end
|
#accept(target) ⇒ Object
5
6
7
|
# File 'lib/csspool/node.rb', line 5
def accept target
target.accept self
end
|
#children ⇒ Object
33
34
35
|
# File 'lib/csspool/node.rb', line 33
def children
accept Visitors::Children.new
end
|
#hash ⇒ Object
37
38
39
|
# File 'lib/csspool/node.rb', line 37
def hash
@hash ||= children.map { |child| child.hash }.hash
end
|
#to_css(options = {}) ⇒ Object
Also known as:
to_s
9
10
11
12
13
14
15
|
# File 'lib/csspool/node.rb', line 9
def to_css options={}
if options[:minify]
to_minified_css
else
accept Visitors::ToCSS.new
end
end
|
#to_minified_css ⇒ Object