Class: SyntaxTree::CSS::PercentageToken
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A parsed token that contains a numeric value with a percentage sign. www.w3.org/TR/css-syntax-3/#typedef-percentage-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:) ⇒ PercentageToken
constructor
A new instance of PercentageToken.
Methods inherited from Node
Constructor Details
#initialize(value:, type:, location:) ⇒ PercentageToken
Returns a new instance of PercentageToken.
716 717 718 719 720 |
# File 'lib/syntax_tree/css/nodes.rb', line 716 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.
714 715 716 |
# File 'lib/syntax_tree/css/nodes.rb', line 714 def location @location end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
714 715 716 |
# File 'lib/syntax_tree/css/nodes.rb', line 714 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
714 715 716 |
# File 'lib/syntax_tree/css/nodes.rb', line 714 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
722 723 724 |
# File 'lib/syntax_tree/css/nodes.rb', line 722 def accept(visitor) visitor.visit_percentage_token(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
726 727 728 |
# File 'lib/syntax_tree/css/nodes.rb', line 726 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
732 733 734 |
# File 'lib/syntax_tree/css/nodes.rb', line 732 def deconstruct_keys(keys) { value: value, type: type, location: location } end |