Class: SyntaxTree::CSS::StyleSheet
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
This is the top node in the tree if it hasn’t been converted into a CSS stylesheet.
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(rules:, location:) ⇒ StyleSheet
constructor
A new instance of StyleSheet.
Methods inherited from Node
Constructor Details
#initialize(rules:, location:) ⇒ StyleSheet
Returns a new instance of StyleSheet.
872 873 874 875 |
# File 'lib/syntax_tree/css/nodes.rb', line 872 def initialize(rules:, location:) @rules = rules @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
870 871 872 |
# File 'lib/syntax_tree/css/nodes.rb', line 870 def location @location end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
870 871 872 |
# File 'lib/syntax_tree/css/nodes.rb', line 870 def rules @rules end |
Instance Method Details
#accept(visitor) ⇒ Object
877 878 879 |
# File 'lib/syntax_tree/css/nodes.rb', line 877 def accept(visitor) visitor.visit_stylesheet(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
881 882 883 |
# File 'lib/syntax_tree/css/nodes.rb', line 881 def child_nodes rules end |
#deconstruct_keys(keys) ⇒ Object
887 888 889 |
# File 'lib/syntax_tree/css/nodes.rb', line 887 def deconstruct_keys(keys) { rules: rules, location: location } end |