Class: HelloWorldGem::Translator

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

Instance Method Summary collapse

Constructor Details

#initialize(language) ⇒ Translator

Returns a new instance of Translator.



4
5
6
# File 'lib/hello_world_gem/translator.rb', line 4

def initialize(language)
  @language = language
end

Instance Method Details

#hiObject



8
9
10
11
12
13
14
15
# File 'lib/hello_world_gem/translator.rb', line 8

def hi
  case @language
    when "English"
      "Hello, world!"
    else
      "oh hai thar"
  end
end