Class: JsxRosetta::AST::JSXElement

Inherits:
Node
  • Object
show all
Defined in:
lib/jsx_rosetta/ast/types.rb

Constant Summary

Constants inherited from Node

Node::TYPE_REGISTRY

Instance Attribute Summary

Attributes inherited from Node

#raw

Instance Method Summary collapse

Methods inherited from Node

#==, #[], #children, #deconstruct_keys, #dig, #each_child, #end_pos, #hash, #initialize, #inspect, #loc, #range, register, #start_pos, #type, #walk, wrap

Constructor Details

This class inherits a constructor from JsxRosetta::AST::Node

Instance Method Details

#closing_elementObject



42
43
44
# File 'lib/jsx_rosetta/ast/types.rb', line 42

def closing_element
  self[:closing_element]
end

#jsx_childrenObject



46
47
48
# File 'lib/jsx_rosetta/ast/types.rb', line 46

def jsx_children
  self[:children]
end

#opening_elementObject



38
39
40
# File 'lib/jsx_rosetta/ast/types.rb', line 38

def opening_element
  self[:opening_element]
end

#self_closing?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/jsx_rosetta/ast/types.rb', line 54

def self_closing?
  opening_element&.self_closing? || false
end

#tag_nameObject



50
51
52
# File 'lib/jsx_rosetta/ast/types.rb', line 50

def tag_name
  opening_element&.tag_name
end