Class: WordOfTheDay::Adapter::Transparent
- Inherits:
-
Base
- Object
- Base
- WordOfTheDay::Adapter::Transparent
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
Instance Method Details
#url ⇒ Object
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
|
#word ⇒ Object
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
|