hola_qwertix 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hola_qwertic.rb +12 -2
- data/lib/hola_qwertic/translator.rb +31 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5c28c9a37664cef900ea9ec169e6f205b1802fc26b7c1ec9b324e3dd3970ed7
|
4
|
+
data.tar.gz: e6b0a8bdf87208ddf8c6d8ebe842dcb4265a3486da52630a8df22899bd47b0ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef408d73da9085e7c4aa996ddc0119ee3c15b22cfd3d356327cef5672c8d63d491dc91d004a2d3f4fb25fecca04dafc2047ee7db00cb9d1c29d12e5c59eed603
|
7
|
+
data.tar.gz: 62029322269c51ba8b1ae6b2c243659bbdbe2f5b9fc8e3b1c79f0a02b08bb1e6c2022f50a6cc21e45d096778b55d06d44935fc4dd6993f9fa5904a78161dd73c
|
data/lib/hola_qwertic.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
class HolaQwertic
|
2
|
-
def self.hi
|
3
|
-
|
2
|
+
def self.hi(language = "en", name)
|
3
|
+
translator = Translator.new(language)
|
4
|
+
translator.hi(name)
|
4
5
|
end
|
6
|
+
|
7
|
+
def self.age(language = "en", age)
|
8
|
+
translator = Translator.new(language)
|
9
|
+
translator.age(age)
|
10
|
+
end
|
5
11
|
end
|
12
|
+
|
13
|
+
require 'hola_qwertic/translator'
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class HolaQwertic::Translator
|
2
|
+
def initialize(language)
|
3
|
+
@language = language
|
4
|
+
end
|
5
|
+
|
6
|
+
def hi(name)
|
7
|
+
case @language
|
8
|
+
when "es"
|
9
|
+
"Hola soy #{name}"
|
10
|
+
when "it"
|
11
|
+
"Ciao sono #{name}"
|
12
|
+
when "fr"
|
13
|
+
"Salut je suis #{name}"
|
14
|
+
else
|
15
|
+
"Hello I am #{name}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def age(years)
|
20
|
+
case @language
|
21
|
+
when "es"
|
22
|
+
"Tengo #{years} años"
|
23
|
+
when "it"
|
24
|
+
"Ciao ho #{years} anni"
|
25
|
+
when "fr"
|
26
|
+
"J'ai #{years} ans"
|
27
|
+
else
|
28
|
+
"I am #{years} old"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hola_qwertix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Regi Voda
|
@@ -17,6 +17,7 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/hola_qwertic.rb
|
20
|
+
- lib/hola_qwertic/translator.rb
|
20
21
|
homepage: https://rubygems.org/gems/hola_qwertic
|
21
22
|
licenses:
|
22
23
|
- MIT
|
@@ -40,5 +41,5 @@ rubyforge_project:
|
|
40
41
|
rubygems_version: 2.7.6
|
41
42
|
signing_key:
|
42
43
|
specification_version: 4
|
43
|
-
summary: Hola
|
44
|
+
summary: Hola!
|
44
45
|
test_files: []
|