Class: Carbon::Concrete::Item::Struct::Element Private
- Inherits:
-
Object
- Object
- Carbon::Concrete::Item::Struct::Element
- Defined in:
- lib/carbon/concrete/item/struct/element.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class is frozen upon initialization. This means that any attempt to modify it will result in an error. In most cases, the attributes on this class will also be frozen, as well.
An element of a struct. Contains name and type information, and that's it.
Instance Attribute Summary collapse
-
#name ⇒ ::String
readonly
private
The name of the element.
-
#type ⇒ Type
readonly
private
The type of the element.
Instance Method Summary collapse
-
#initialize(name, type) ⇒ Element
constructor
private
Initialize the element with the given name and type.
Constructor Details
#initialize(name, type) ⇒ Element
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize the element with the given name and type.
33 34 35 36 37 |
# File 'lib/carbon/concrete/item/struct/element.rb', line 33 def initialize(name, type) @name = name @type = type deep_freeze! end |
Instance Attribute Details
#name ⇒ ::String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The name of the element.
20 21 22 |
# File 'lib/carbon/concrete/item/struct/element.rb', line 20 def name @name end |
#type ⇒ Type (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The type of the element.
25 26 27 |
# File 'lib/carbon/concrete/item/struct/element.rb', line 25 def type @type end |