full_name 0.0.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/full_name.rb +26 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bdbda507bf222f2fa05ff05a0d60a1f85289a16
4
- data.tar.gz: 0833bf2db3caf6f1a55864ff0d73c36f2ec7b541
3
+ metadata.gz: 4d922e261990297dd4fb0d185e0ff433cafb2898
4
+ data.tar.gz: 047931817f810b2619966608d669cb3a2c1b6f9b
5
5
  SHA512:
6
- metadata.gz: 1e2cdfd7cbc24a9947e030362f20035981e693b523c4e503f3fb99da07403e501bb8cce66358fc6620188c24a4e38fa649656199dc4c5b63d629b4f481991abb
7
- data.tar.gz: 08a2bb2eef7b77fbc0d108fc08a3c5064cc82238e3a793541b6e061f4dd9de1b65eb42b835bfb3a52cb64a05c7373d66614059d5ad1d698c43b4fb8288bb30b2
6
+ metadata.gz: f3a6821683a2b84766169e7cf2622b8bcfb7885d65c7e1195ce7c7bf43c8ec7b19507a207292725d2b98f67580be0a354110c4de5b55e5465206d6af9279c025
7
+ data.tar.gz: 7d6e510e0dd9d69c46844a1ad7b9b89839b36f7296170f6a4c7fc58a8cd1ffea0cbbe0891f53806641b3ddf6ce5d2f98c2e92453d9c059e29a37b6923a155d0d
@@ -1,6 +1,29 @@
1
- class FullName
2
- def self.hi
3
- puts 'Hello World'
1
+ module FullName
2
+ def full_name locale = :en
3
+ if locale != :en and locale != :fr
4
+ return full_name(:en)
5
+ end
6
+
7
+ if first_name and first_name.size > 0
8
+ if last_name and last_name.size > 0
9
+ case locale
10
+ when :en then
11
+ full_name = [first_name.capitalize, last_name.capitalize].join(' ')
12
+ when :fr then
13
+ full_name = "#{last_name.upcase}, #{first_name.capitalize}"
14
+ end
15
+
16
+ else
17
+ full_name = first_name.capitalize
18
+ end
19
+ else
20
+ case locale
21
+ when :en then
22
+ full_name = last_name.capitalize
23
+ when :fr then
24
+ full_name = last_name.upcase
25
+ end
26
+ end
4
27
  end
5
28
  end
6
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: full_name
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoit Gantaume
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-30 00:00:00.000000000 Z
11
+ date: 2013-12-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Adds full_name method for classes that provide a first_name and a last_name!
14
14
  email: benoit@agilidee.com
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/full_name.rb
20
- homepage: http://rubygems.org/gems/full_name
20
+ homepage: https://github.com/AGILiDEE/full_name
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}