Class: SyntaxTree::CSS::QualifiedRule
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
Associates a prelude consisting of a list of component values with a block consisting of a simple {} block. www.w3.org/TR/css-syntax-3/#qualified-rule
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#prelude ⇒ Object
readonly
Returns the value of attribute prelude.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(prelude:, block:, location:) ⇒ QualifiedRule
constructor
A new instance of QualifiedRule.
Methods inherited from Node
Constructor Details
#initialize(prelude:, block:, location:) ⇒ QualifiedRule
Returns a new instance of QualifiedRule.
743 744 745 746 747 |
# File 'lib/syntax_tree/css/nodes.rb', line 743 def initialize(prelude:, block:, location:) @prelude = prelude @block = block @location = location end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
741 742 743 |
# File 'lib/syntax_tree/css/nodes.rb', line 741 def block @block end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
741 742 743 |
# File 'lib/syntax_tree/css/nodes.rb', line 741 def location @location end |
#prelude ⇒ Object (readonly)
Returns the value of attribute prelude.
741 742 743 |
# File 'lib/syntax_tree/css/nodes.rb', line 741 def prelude @prelude end |
Instance Method Details
#accept(visitor) ⇒ Object
749 750 751 |
# File 'lib/syntax_tree/css/nodes.rb', line 749 def accept(visitor) visitor.visit_qualified_rule(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
753 754 755 |
# File 'lib/syntax_tree/css/nodes.rb', line 753 def child_nodes [*prelude, block].compact end |
#deconstruct_keys(keys) ⇒ Object
759 760 761 |
# File 'lib/syntax_tree/css/nodes.rb', line 759 def deconstruct_keys(keys) { prelude: prelude, block: block, location: location } end |