class Translator

Public Class Methods

new(language) click to toggle source
# File lib/greeter/translator.rb, line 2
def initialize(language)
  @language = language
  # put in yaml file
  @translations = {
    'english' => {
      hello_world: 'Hello world'
    },
    'spanish' => {
      hello_world: 'Hola mundo'
    }
  }
end

Public Instance Methods

hi() click to toggle source
# File lib/greeter/translator.rb, line 15
def hi
  @translations[@language][:hello_world]
end