Class: BoneHola::Translator

Inherits:
Object
  • Object
show all
Defined in:
lib/bone_hola/translator.rb

Instance Method Summary collapse

Constructor Details

#initialize(language) ⇒ Translator

init say language



8
9
10
# File 'lib/bone_hola/translator.rb', line 8

def initialize(language)
  self.language = language
end

Instance Method Details

#hiObject

Say hi to the world through tree languanges



13
14
15
16
17
18
19
20
21
22
# File 'lib/bone_hola/translator.rb', line 13

def hi
  case language
    when "english"
      "Hello World!"
    when "spanish"
      "hola mundo!"
    else
      "你好,世界!"
  end
end