Class: SyntaxTree::CSS::CloseSquareToken

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-square

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ CloseSquareToken

Returns a new instance of CloseSquareToken.



256
257
258
# File 'lib/syntax_tree/css/nodes.rb', line 256

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



254
255
256
# File 'lib/syntax_tree/css/nodes.rb', line 254

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



260
261
262
# File 'lib/syntax_tree/css/nodes.rb', line 260

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

#child_nodesObject Also known as: deconstruct



264
265
266
# File 'lib/syntax_tree/css/nodes.rb', line 264

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



270
271
272
# File 'lib/syntax_tree/css/nodes.rb', line 270

def deconstruct_keys(keys)
  { location: location }
end

#valueObject

Here for convenience for comparing between block types.



275
276
277
# File 'lib/syntax_tree/css/nodes.rb', line 275

def value
  "]"
end