Class: SyntaxTree::CSS::Function
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A function has a name and a value consisting of a list of component values. www.w3.org/TR/css-syntax-3/#function
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#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(name:, value:, location:) ⇒ Function
constructor
A new instance of Function.
Methods inherited from Node
Constructor Details
#initialize(name:, value:, location:) ⇒ Function
Returns a new instance of Function.
500 501 502 503 504 |
# File 'lib/syntax_tree/css/nodes.rb', line 500 def initialize(name:, value:, location:) @name = name @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
498 499 500 |
# File 'lib/syntax_tree/css/nodes.rb', line 498 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
498 499 500 |
# File 'lib/syntax_tree/css/nodes.rb', line 498 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
498 499 500 |
# File 'lib/syntax_tree/css/nodes.rb', line 498 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
506 507 508 |
# File 'lib/syntax_tree/css/nodes.rb', line 506 def accept(visitor) visitor.visit_function(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
510 511 512 |
# File 'lib/syntax_tree/css/nodes.rb', line 510 def child_nodes value end |
#deconstruct_keys(keys) ⇒ Object
516 517 518 |
# File 'lib/syntax_tree/css/nodes.rb', line 516 def deconstruct_keys(keys) { name: name, value: value, location: location } end |