class PhotoFlick::Dictionary

This class responsible for providing random words from a dictionary

Public Class Methods

new() click to toggle source
# File lib/photo_flick/dictionary.rb, line 6
def initialize
  path = File.expand_path('../../../data', __FILE__)
  @file =  File.read("#{path}/words")
end

Public Instance Methods

get_random_words(count) click to toggle source
# File lib/photo_flick/dictionary.rb, line 11
def get_random_words(count)
  @file.split("\n").sample(count)
end