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: channel_state.rb
    path of file: ./repos/anycable-rails/lib/anycable/rails
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module AnyCable
  module Rails
    module ChannelState
      module ClassMethods
       
    
        def state_attr_accessor(*names)
          names.each do |name|
            connection_state_attributes << name
            class_eval <<~RUBY, __FILE__, __LINE__ + 1
              def #{name}
                return @#{name} if instance_variable_defined?(:@#{name})
                @#{name} = AnyCable::Rails.deserialize(__cstate__["#{name}"], json: true) if anycabled?
              end

              def #{name}=(val)
                __cstate__["#{name}"] = AnyCable::Rails.serialize(val, json: true) if anycabled?
                instance_variable_set(:@#{name}, val)
              end
            RUBY
          end
        end