# encoding: utf-8 # frozen_string_literal: true module Carbon module Concrete module Item class Struct # An element of a struct. Contains name and type information, and # that's it. # # @api private # @note # **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. class Element # The name of the element. # # @return [::String] attr_reader :name # The type of the element. # # @return [Type] attr_reader :type # Initialize the element with the given name and type. # # @see #name # @see #type # @param name [::String] The name of the element. # @param type [Type] The type of the element. def initialize(name, type) @name = name @type = type deep_freeze! end end end end end end