Class: JsxRosetta::AST::JSXAttribute

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

#attribute_nameObject



156
157
158
159
160
161
# File 'lib/jsx_rosetta/ast/types.rb', line 156

def attribute_name
  case (attr_name = name)
  when JSXIdentifier then attr_name.name
  when JSXNamespacedName then attr_name.qualified_name
  end
end

#nameObject



148
149
150
# File 'lib/jsx_rosetta/ast/types.rb', line 148

def name
  self[:name]
end

#valueObject



152
153
154
# File 'lib/jsx_rosetta/ast/types.rb', line 152

def value
  self[:value]
end