Class: SyntaxTree::CSS::SimpleBlock
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A simple block has an associated token (either a <[-token>, <(-token>, or <{-token>) and a value consisting of a list of component values. www.w3.org/TR/css-syntax-3/#simple-block
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(token:, value:, location:) ⇒ SimpleBlock
constructor
A new instance of SimpleBlock.
Methods inherited from Node
Constructor Details
#initialize(token:, value:, location:) ⇒ SimpleBlock
Returns a new instance of SimpleBlock.
794 795 796 797 798 |
# File 'lib/syntax_tree/css/nodes.rb', line 794 def initialize(token:, value:, location:) @token = token @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
792 793 794 |
# File 'lib/syntax_tree/css/nodes.rb', line 792 def location @location end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
792 793 794 |
# File 'lib/syntax_tree/css/nodes.rb', line 792 def token @token end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
792 793 794 |
# File 'lib/syntax_tree/css/nodes.rb', line 792 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
800 801 802 |
# File 'lib/syntax_tree/css/nodes.rb', line 800 def accept(visitor) visitor.visit_simple_block(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
804 805 806 |
# File 'lib/syntax_tree/css/nodes.rb', line 804 def child_nodes value end |
#deconstruct_keys(keys) ⇒ Object
810 811 812 |
# File 'lib/syntax_tree/css/nodes.rb', line 810 def deconstruct_keys(keys) { token: token, value: value, location: location } end |