Structures (records)

Alphabet = Struct.new(:lang) do
    def [](i)
        return (64 + i).chr
    end
end

alphabet = Alphabet.new("en")
charA = alphabet[1]
# charA is "A"

charE = alphabet[5]
# charE is "E"

puts "charA is #{charA}"
puts "charE is #{charE}"