Class: WordOfTheDay::Adapter::Transparent

Inherits:
Base
  • Object
show all
Defined in:
lib/rodbot/plugins/word_of_the_day/lib/adapters/transparent.rb

Constant Summary collapse

LANGUAGE_CODES =
{
  'arabic' => 'ar',
  'chinese' => 'zh',
  'dutch' => 'nl',
  'esperanto' => 'esp',
  'french' => 'fr',
  'german' => 'de',
  'irish' => 'ga',
  'italian' => 'it',
  'japanese' => 'ja',
  'latin' => 'la',
  'polish' => 'pl',
  'portuguese' => 'pt',
  'russian' => 'ru',
  'spanish' => 'es'
}.freeze

Instance Attribute Summary

Attributes inherited from Base

#language

Instance Method Summary collapse

Methods inherited from Base

#initialize, #message

Constructor Details

This class inherits a constructor from WordOfTheDay::Adapter::Base

Instance Method Details

#urlObject



27
28
29
# File 'lib/rodbot/plugins/word_of_the_day/lib/adapters/transparent.rb', line 27

def url
  "https://wotd.transparent.com/widget/?lang=#{language}&date=#{today}"
end

#wordObject



23
24
25
# File 'lib/rodbot/plugins/word_of_the_day/lib/adapters/transparent.rb', line 23

def word
  xml.match(/<word>(.+?)</)&.captures&.first
end