client_data 0.1.4 → 0.1.5
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 +7 -1
- data/lib/client_data/methods.rb +7 -1
- data/lib/client_data/version.rb +1 -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: b6e3911baafa6ddf8650808607f0f55dbf359c7a
|
4
|
+
data.tar.gz: 3e79c97a3a4f070acec57c85e22ce917e8f33f71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8eda8ca31f669307e3ce36c25f003d6c3b33a0026b5000f60dc8db63b57495d716c2fc3363ee85b42c4186cecd9f18f4d24ea7577536156eef1cbcb815c93d83
|
7
|
+
data.tar.gz: cf2c196dc8282f07ff6e4aa9787ce92f934340c79f79664ca549641ab109cbd293c106ec5ce27de4425aea7737fd74029b6f48b256da3d2531eff80849a53d62
|
data/lib/client_data/builder.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
module ClientData
|
2
2
|
class Builder
|
3
3
|
attr_accessor :controller
|
4
|
+
attr_reader :options
|
4
5
|
|
5
|
-
def initialize(controller = nil)
|
6
|
+
def initialize(controller = nil, options = {})
|
6
7
|
@controller = controller
|
8
|
+
@options = options
|
7
9
|
end
|
8
10
|
|
9
11
|
def self.properties(*props)
|
@@ -21,6 +23,10 @@ module ClientData
|
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
26
|
+
|
27
|
+
def self.builder_name
|
28
|
+
self.name.split('::').last.chomp('Builder').underscore
|
29
|
+
end
|
24
30
|
end
|
25
31
|
end
|
26
32
|
|
data/lib/client_data/methods.rb
CHANGED
@@ -21,6 +21,11 @@ module ClientData
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def client_data_options(builder_name, options)
|
25
|
+
builder_options_hash[builder_name.to_sym] ||= {}
|
26
|
+
builder_options_hash[builder_name.to_sym].merge!(options)
|
27
|
+
end
|
28
|
+
|
24
29
|
def builders
|
25
30
|
@builders ||= begin
|
26
31
|
builders_hash = {}
|
@@ -82,7 +87,8 @@ module ClientData
|
|
82
87
|
"Error: #{e.message}"
|
83
88
|
end
|
84
89
|
|
85
|
-
klass.
|
90
|
+
options = builder_options_hash[klass.builder_name.to_sym].dup || {}
|
91
|
+
klass.new(self, options).tap { |o| o.controller = self }
|
86
92
|
end
|
87
93
|
|
88
94
|
def builder_namespace
|
data/lib/client_data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: client_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stan Bondi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|