human_name 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/human_name/methods.rb +10 -2
- data/lib/human_name/version.rb +1 -1
- data/lib/human_name.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f654a2be4b673ec54374341a6498abba400e0c26
|
4
|
+
data.tar.gz: 8452551ca6880e9bb4fb5a7ebbc120d8ef97e354
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b7b6ea66ad4388540418c80a53e903f43237bb854713597c048a9e3b9fafd8d272b6afefc59cde251c1f09b5594bb4c7d809b76cd1260b41ccc77cf3ade85ad
|
7
|
+
data.tar.gz: f33ad73b520220281c237ed7a0cbf7437f4a38b20ba7c80dc20fe0afb672408eb6504fbbf7ec1d20472828de0e4655e44ed834879e55018912317a021c123c25
|
data/lib/human_name/methods.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "forwardable"
|
2
|
+
|
1
3
|
class HumanName
|
2
4
|
class Methods < Module
|
3
5
|
def initialize(first_name_method = :first_name, last_name_method = :last_name)
|
@@ -15,8 +17,14 @@ class HumanName
|
|
15
17
|
HumanName.new(first_name, last_name)
|
16
18
|
end
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
+
if Module.respond_to?(:delegate)
|
21
|
+
# Assume the ActiveSupport Core Extension for method delegation has
|
22
|
+
# been included
|
23
|
+
delegate :full_name, :name_initials, to: :human_name
|
24
|
+
else
|
25
|
+
extend Forwardable
|
26
|
+
def_delegators :human_name, :full_name, :name_initials
|
27
|
+
end
|
20
28
|
end
|
21
29
|
end
|
22
30
|
end
|
data/lib/human_name/version.rb
CHANGED
data/lib/human_name.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: human_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maarten Claes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|