Class: SyntaxTree::CSS::URLToken
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A parsed token that contains a URL. Note that this is different from a function call to the “url” function only if quotes aren’t used. www.w3.org/TR/css-syntax-3/#typedef-url-token
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#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:, location:) ⇒ URLToken
constructor
A new instance of URLToken.
Methods inherited from Node
Constructor Details
#initialize(value:, location:) ⇒ URLToken
Returns a new instance of URLToken.
924 925 926 927 |
# File 'lib/syntax_tree/css/nodes.rb', line 924 def initialize(value:, location:) @value = value @location = Location.from(location) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
922 923 924 |
# File 'lib/syntax_tree/css/nodes.rb', line 922 def location @location end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
922 923 924 |
# File 'lib/syntax_tree/css/nodes.rb', line 922 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
929 930 931 |
# File 'lib/syntax_tree/css/nodes.rb', line 929 def accept(visitor) visitor.visit_url_token(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
933 934 935 |
# File 'lib/syntax_tree/css/nodes.rb', line 933 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
939 940 941 |
# File 'lib/syntax_tree/css/nodes.rb', line 939 def deconstruct_keys(keys) { value: value, location: location } end |