Skip to content

Commit

Permalink
add a directory with code
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Apr 29, 2011
1 parent 9498b0b commit ea44e82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/hola.rb
@@ -1,5 +1,8 @@
class Hola
def self.hi
puts "Hello world!"
def self.hi(language)
translator = Translator.new(language)
puts translator.hi
end
end

require 'hola/translator'
14 changes: 14 additions & 0 deletions lib/hola/translator.rb
@@ -0,0 +1,14 @@
class Hola::Translator
def initialize(language = :english)
@language = language
end

def hi
case @language
when :spanish
"hola mundo"
else
"hello world"
end
end
end

0 comments on commit ea44e82

Please sign in to comment.