Class: FlickrbCollage::KeywordSource
- Inherits:
-
Object
- Object
- FlickrbCollage::KeywordSource
- Defined in:
- lib/flickrb_collage/keyword_source.rb
Instance Attribute Summary collapse
-
#dictionary_path ⇒ Object
readonly
Returns the value of attribute dictionary_path.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(dictionary_path = '/usr/share/dict/words') ⇒ KeywordSource
constructor
A new instance of KeywordSource.
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_path ⇒ Object (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
#call ⇒ Object
9 10 11 |
# File 'lib/flickrb_collage/keyword_source.rb', line 9 def call File.readlines(dictionary_path).sample end |