Class: SyntaxTree::CSS::OpenParenToken

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/css/nodes.rb

Overview

A parsed token that represents the use of a (. www.w3.org/TR/css-syntax-3/#tokendef-open-paren

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ OpenParenToken

Returns a new instance of OpenParenToken.



658
659
660
# File 'lib/syntax_tree/css/nodes.rb', line 658

def initialize(location:)
  @location = Location.from(location)
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



656
657
658
# File 'lib/syntax_tree/css/nodes.rb', line 656

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



662
663
664
# File 'lib/syntax_tree/css/nodes.rb', line 662

def accept(visitor)
  visitor.visit_open_paren_token(self)
end

#child_nodesObject Also known as: deconstruct



666
667
668
# File 'lib/syntax_tree/css/nodes.rb', line 666

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



672
673
674
# File 'lib/syntax_tree/css/nodes.rb', line 672

def deconstruct_keys(keys)
  { location: location }
end

#valueObject

Here for convenience for comparing between block types.



677
678
679
# File 'lib/syntax_tree/css/nodes.rb', line 677

def value
  "("
end