Class: QuartzTorrent::Words

Inherits:
Object
  • Object
show all
Defined in:
lib/quartz_flow/mock_client.rb

Instance Method Summary collapse

Constructor Details

#initializeWords

Returns a new instance of Words.



11
12
13
14
15
16
17
18
# File 'lib/quartz_flow/mock_client.rb', line 11

def initialize
  @words = []
  File.open "/usr/share/dict/words", "r" do |file|
    file.each_line do |l|
      @words.push l.chomp
    end
  end
end

Instance Method Details

#randomWordObject



20
21
22
# File 'lib/quartz_flow/mock_client.rb', line 20

def randomWord
  @words[rand(@words.size)]
end