You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: class_state.rb
    path of file: ./repos/pakyow/support/lib/pakyow/support
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require_relative "deep_dup"

module Pakyow
  module Support
    module ClassState
      using DeepDup

      def class_state(name, default: nil, inheritable: false, reader: true)
        ivar = :"@#{name}"

        @__class_state[ivar] = {
          default: default,
          inheritable: inheritable
        }

        instance_variable_set(ivar, default.deep_dup)

        if reader 
    
      def inherited(subclass)
        subclass.instance_variable_set(:@__class_state, @__class_state.deep_dup)

        @__class_state.each do |ivar, options|
          if options[:inheritable]
            subclass.instance_variable_set(ivar, instance_variable_get(ivar).deep_dup)
          elsif @__class_state[ivar][:default]
            subclass.instance_variable_set(ivar, @__class_state[ivar][:default].deep_dup)
          else
            subclass.instance_variable_set(ivar, nil)
          end
        end