Class: SyntaxTree::CSS::NumberToken
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A parsed token that contains a numeric value. www.w3.org/TR/css-syntax-3/#typedef-number-token
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#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(value:, type:, location:) ⇒ NumberToken
constructor
A new instance of NumberToken.
Methods inherited from Node
Constructor Details
#initialize(value:, type:, location:) ⇒ NumberToken
Returns a new instance of NumberToken.
603 604 605 606 607 |
# File 'lib/syntax_tree/css/nodes.rb', line 603 def initialize(value:, type:, location:) @value = value @type = type @location = Location.from(location) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
601 602 603 |
# File 'lib/syntax_tree/css/nodes.rb', line 601 def location @location end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
601 602 603 |
# File 'lib/syntax_tree/css/nodes.rb', line 601 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
601 602 603 |
# File 'lib/syntax_tree/css/nodes.rb', line 601 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
609 610 611 |
# File 'lib/syntax_tree/css/nodes.rb', line 609 def accept(visitor) visitor.visit_number_token(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
613 614 615 |
# File 'lib/syntax_tree/css/nodes.rb', line 613 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
619 620 621 |
# File 'lib/syntax_tree/css/nodes.rb', line 619 def deconstruct_keys(keys) { value: value, type: type, location: location } end |