Class: RandomYoutubeComment::WordnikClient

Inherits:
Object
  • Object
show all
Defined in:
lib/random_youtube_comment/wordnik_client.rb

Class Method Summary collapse

Class Method Details

.clientObject



10
11
12
13
14
15
16
17
# File 'lib/random_youtube_comment/wordnik_client.rb', line 10

def client
  Wordnik.configure do |config|
    config.api_key = RandomYoutubeComment.configuration.wordnik_api_key
    config.logger = Logger.new('/dev/null')
  end unless @client

  @client ||= Wordnik.words
end

.random_wordObject



6
7
8
# File 'lib/random_youtube_comment/wordnik_client.rb', line 6

def random_word
  client.get_random_word(:hasDictionaryDef => 'true')["word"]
end