class Freakin::Translator

An instance of Translator will determine what greeting to return based on the language selected when its instantiated

Public Class Methods

new(language) click to toggle source

Instantiate a new instance of Translator for a chosen language

Examples

Freakin::Translator.new('spanish')
# File lib/freakin/translator.rb, line 11
def initialize(language)
  @language = language
end

Public Instance Methods

hi() click to toggle source

Call to return a greeting

Examples

foo = Freakin::Translator.new('spanish')
foo.hi # 'hola mundo'
# File lib/freakin/translator.rb, line 21
def hi
  case @language
  when 'spanish'
    'hola mundo'
  else
    'hello world'
  end
end