Class: SyntaxTree::CSS::CloseParenToken

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-close-paren

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ CloseParenToken

Returns a new instance of CloseParenToken.



227
228
229
# File 'lib/syntax_tree/css/nodes.rb', line 227

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



225
226
227
# File 'lib/syntax_tree/css/nodes.rb', line 225

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



231
232
233
# File 'lib/syntax_tree/css/nodes.rb', line 231

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

#child_nodesObject Also known as: deconstruct



235
236
237
# File 'lib/syntax_tree/css/nodes.rb', line 235

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



241
242
243
# File 'lib/syntax_tree/css/nodes.rb', line 241

def deconstruct_keys(keys)
  { location: location }
end

#valueObject

Here for convenience for comparing between block types.



246
247
248
# File 'lib/syntax_tree/css/nodes.rb', line 246

def value
  ")"
end