# File lib/creatable/class_methods.rb, line 18
    def attribute(name: nil, type: 'accessor', kind_of: nil, &block)
      raise ArgumentError, 'name is a required parameter' unless name
      raise ArgumentError, "type must be of type: 'accessor', 'reader', or 'writer'" unless ['accessor', 'reader', 'writer'].include? type

      generate_reader(name) if ['accessor', 'reader'].include?(type)

      if ['accessor', 'writer'].include?(type)
        if kind_of.nil?
          generate_writer(name)
        else
          kind_of = [kind_of] unless kind_of.is_a? Array
          generate_required_writer(name, kind_of)
        end
      end

      attributes.delete_if { |e| e[:name] == name } if attributes.map { |e| e[:name] }.include? name

      attributes.push(name: name, type: type, kind_of: kind_of, block: block)
      nil
    end