Class: SyntaxTree::CSS::OpenCurlyToken

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ OpenCurlyToken

Returns a new instance of OpenCurlyToken.



629
630
631
# File 'lib/syntax_tree/css/nodes.rb', line 629

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



627
628
629
# File 'lib/syntax_tree/css/nodes.rb', line 627

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



633
634
635
# File 'lib/syntax_tree/css/nodes.rb', line 633

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

#child_nodesObject Also known as: deconstruct



637
638
639
# File 'lib/syntax_tree/css/nodes.rb', line 637

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



643
644
645
# File 'lib/syntax_tree/css/nodes.rb', line 643

def deconstruct_keys(keys)
  { location: location }
end

#valueObject

Here for convenience for comparing between block types.



648
649
650
# File 'lib/syntax_tree/css/nodes.rb', line 648

def value
  "{"
end