Class: SyntaxTree::CSS::CloseCurlyToken

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ CloseCurlyToken

Returns a new instance of CloseCurlyToken.



198
199
200
# File 'lib/syntax_tree/css/nodes.rb', line 198

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



196
197
198
# File 'lib/syntax_tree/css/nodes.rb', line 196

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



202
203
204
# File 'lib/syntax_tree/css/nodes.rb', line 202

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

#child_nodesObject Also known as: deconstruct



206
207
208
# File 'lib/syntax_tree/css/nodes.rb', line 206

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



212
213
214
# File 'lib/syntax_tree/css/nodes.rb', line 212

def deconstruct_keys(keys)
  { location: location }
end

#valueObject

Here for convenience for comparing between block types.



217
218
219
# File 'lib/syntax_tree/css/nodes.rb', line 217

def value
  "}"
end