client_data 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/client_data/builder.rb +1 -1
- data/lib/client_data/methods.rb +12 -9
- data/lib/client_data/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7074dfc10a10c2d65cea097fb30b841a965ccad4
|
4
|
+
data.tar.gz: cb532832ec22432dae24b5bc2eb41bf482bd2797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3798648fed6ea6a73cd795b3bcd9c808cedbf4dbeceaaaf8336f150ed87e085be57f6daac6f5b85c7e883a5146710d07bd7dd8e06faff8a6fc0a325216af4db3
|
7
|
+
data.tar.gz: a26502b655d6605430bd7b5e6061607a8646a050fa4b037cc40d9d1299f97c075fbadf5c2320fdd28b6d753ade10949319035cae5ec5dafa96f2054c280dedef
|
data/lib/client_data/builder.rb
CHANGED
data/lib/client_data/methods.rb
CHANGED
@@ -11,16 +11,14 @@ module ClientData
|
|
11
11
|
|
12
12
|
module ClassMethods
|
13
13
|
def client_data(*configs)
|
14
|
-
self.__cs_builders ||=
|
15
|
-
self.__cs_builders
|
16
|
-
self.__cs_builders[self.name].concat(configs)
|
14
|
+
self.__cs_builders ||= []
|
15
|
+
self.__cs_builders.concat(configs).uniq!
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
20
19
|
module InstanceMethods
|
21
20
|
def client_data_filter
|
22
|
-
|
23
|
-
configs.each do |key|
|
21
|
+
config_keys.each do |key|
|
24
22
|
begin
|
25
23
|
klass = "#{builder_namespace}#{key.to_s.capitalize}Builder"
|
26
24
|
klass = klass.constantize
|
@@ -51,10 +49,15 @@ module ClientData
|
|
51
49
|
@provider ||= Adapters.factory(self)
|
52
50
|
end
|
53
51
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
def config_keys
|
53
|
+
@keys ||= begin
|
54
|
+
keys = []
|
55
|
+
klass = self.class
|
56
|
+
loop do
|
57
|
+
keys += klass.__cs_builders || [] if klass.respond_to?(:__cs_builders)
|
58
|
+
break keys unless klass.respond_to?(:superclass) && klass = klass.superclass
|
59
|
+
end
|
60
|
+
end
|
58
61
|
end
|
59
62
|
end
|
60
63
|
end
|
data/lib/client_data/version.rb
CHANGED