HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/rubies/default/lib/ruby/gems/3.0.0/gems/typeprof-0.12.0/smoke/ivar2.rb
class Foo
  def initialize
    @array = []
    @hash = {}
  end

  def set
    @array << 1
    @array << "str"
    @array << :sym
    @hash[:a] = 1
    @hash[:b] = "str"
    @hash[:c] = :sym
  end

  attr_reader :array, :hash
end

Foo.new.array
Foo.new.hash
Foo.new.set

__END__
# Classes
class Foo
  def initialize: -> Hash[bot, bot]
  def set: -> :sym
  attr_reader array: Array[:sym | Integer | String]
  attr_reader hash: {a: Integer, b: String, c: :sym}
end