Class: WordOfTheDay::Adapter::Base
- Inherits:
-
Object
- Object
- WordOfTheDay::Adapter::Base
- Defined in:
- lib/rodbot/plugins/word_of_the_day/lib/adapters/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#language ⇒ Object
readonly
Returns the value of attribute language.
Instance Method Summary collapse
-
#initialize(language) ⇒ Base
constructor
A new instance of Base.
- #message ⇒ Object
Constructor Details
#initialize(language) ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/rodbot/plugins/word_of_the_day/lib/adapters/base.rb', line 10 def initialize(language) @language = language.downcase end |
Instance Attribute Details
#language ⇒ Object (readonly)
Returns the value of attribute language.
8 9 10 |
# File 'lib/rodbot/plugins/word_of_the_day/lib/adapters/base.rb', line 8 def language @language end |
Instance Method Details
#message ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rodbot/plugins/word_of_the_day/lib/adapters/base.rb', line 14 def if word "[#{word}](#{url}) (#{language.capitalize})" else "~~#{language.capitalize}~~" end end |