Class: FlickrbCollage::KeywordSource

Inherits:
Object
  • Object
show all
Defined in:
lib/flickrb_collage/keyword_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dictionary_path = '/usr/share/dict/words') ⇒ KeywordSource

Returns a new instance of KeywordSource.



5
6
7
# File 'lib/flickrb_collage/keyword_source.rb', line 5

def initialize(dictionary_path = '/usr/share/dict/words')
  @dictionary_path = dictionary_path
end

Instance Attribute Details

#dictionary_pathObject (readonly)

Returns the value of attribute dictionary_path.



3
4
5
# File 'lib/flickrb_collage/keyword_source.rb', line 3

def dictionary_path
  @dictionary_path
end

Instance Method Details

#callObject



9
10
11
# File 'lib/flickrb_collage/keyword_source.rb', line 9

def call
  File.readlines(dictionary_path).sample
end