auto_add_name 1.0.0 → 1.0.1
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/auto_add_name.rb +12 -0
- 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: 4fa86f1e02b444acb93c0cfa8e3db91e0aeb43e2
|
4
|
+
data.tar.gz: 7a09f49b50f14c535a458da7fc868cba58ce2d09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 928a6ce7e26316785261287c18aa6d7f5e578ffaae67461a82be60ba4ddd852a3672d1ab31854f19ec6a4b910ac9769f56e4877102160873d01a8937ad6135fb
|
7
|
+
data.tar.gz: 5b0f37e821bcd6aab205df023906c0b636a04e2837896ceec32c465ed8fafe50a3535363ae2b7fe21ffc0fc14331dc3e01fc0311131ec6c6e282334462cacd31
|
data/lib/auto_add_name.rb
CHANGED
@@ -12,6 +12,18 @@ module AutoAddName #:nodoc:
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
def h(sym, class_name = nil, other_sym = nil )
|
16
|
+
h_val = send(sym)
|
17
|
+
sym = other_sym if other_sym.present?
|
18
|
+
return "" if h_val.blank?
|
19
|
+
clazz = class_name.nil? ? self.class : class_name.constantize
|
20
|
+
if h_val.is_a?(String)
|
21
|
+
eval("#{clazz}::#{sym.to_s.upcase}['#{h_val}']")
|
22
|
+
else
|
23
|
+
eval("#{clazz}::#{sym.to_s.upcase}[#{h_val}]")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
15
27
|
def update_ass_name
|
16
28
|
self.aan_args.each do |arg|
|
17
29
|
# :cgfs => {key: :code, ass_method: :pcc_names}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto_add_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Zhou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: auto_add_name
|
14
14
|
email: jacobz@yeah.net
|