Sha256: 4a82da73853a468c762f95718673bd5df70f2abc86a6e2d4b28897c6e1b76d48

Contents?: true

Size: 462 Bytes

Versions: 1

Compression:

Stored size: 462 Bytes

Contents

require "amatch"

module GuessWho
  module NamesLoader
    def self.load!
      names = []

      filenames = [
        "files/initials.txt",
        "files/females.txt",
        "files/males.txt",
        "files/surnames.txt"
      ]

      filenames.each do |filename|
        f = File.open(filename, "r")
        f.each_line { |l| names << l.split(" ")[0] }
        f.close
      end

      @@names = names
    end

    def self.names; @@names; end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
guess_who-0.1.0 lib/guess_who/names_loader.rb