class RuboCop::Cop::Sorbet::ForbidTStruct::TStructWalker

translated into ‘attr_reader` and `attr_accessor` methods.
This class walks down the class body of a T::Struct and collects all the properties that will need to be

def initialize

def initialize
  @props = []
  @has_extend_t_sig = false
end

def on_send(node)

def on_send(node)
  if extend_t_sig?(node)
    # So we know we won't need to generate again a `extend T::Sig` line in the new class body
    @has_extend_t_sig = true
    return
  end
  return unless t_struct_prop?(node)
  kind = node.method?(:const) ? :attr_reader : :attr_accessor
  name = node.arguments[0].source.delete_prefix(":")
  type = node.arguments[1].source
  default = nil
  factory = nil
  node.arguments[2..-1].each do |arg|
    next unless arg.hash_type?
    arg.each_pair do |key, value|
      case key.source
      when "default"
        default = value.source
      when "factory"
        factory = value.source
      end
    end
  end
  @props << Property.new(node, kind, name, type, default: default, factory: factory)
end