Class: Helloworld_Victorp::Translator
- Inherits:
-
Object
- Object
- Helloworld_Victorp::Translator
- Defined in:
- lib/helloworld_victorp/translator.rb
Instance Method Summary collapse
- #hi ⇒ Object
-
#initialize(language) ⇒ Translator
constructor
A new instance of Translator.
Constructor Details
#initialize(language) ⇒ Translator
Returns a new instance of Translator.
4 5 6 |
# File 'lib/helloworld_victorp/translator.rb', line 4 def initialize(language) @language = language end |
Instance Method Details
#hi ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/helloworld_victorp/translator.rb', line 8 def hi case @language when "spanish" "Hola Mundo!" else "Hello World!" end end |