Sha256: 2e40b6575330494434bbc2ab773ee1d0bb416f6cd10b437881f291d7ca7d972d

Contents?: true

Size: 332 Bytes

Versions: 1

Compression:

Stored size: 332 Bytes

Contents

module PhotoFlick
  # This class responsible for providing random words from a 
  # dictionary 
  class Dictionary

    def initialize
      path = File.expand_path('../../../data', __FILE__)
      @file =  File.read("#{path}/words")
    end

    def get_random_words(count)
      @file.split("\n").sample(count)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
photo_flick-0.1.0 lib/photo_flick/dictionary.rb