dynamini 2.9.6 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +17 -20
- data/dynamini.gemspec +1 -1
- data/lib/dynamini/attributes.rb +11 -0
- data/spec/dynamini/attributes_spec.rb +14 -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: 550e30d31da4f4477173bed3f3bfdc2e2f2737c5
|
4
|
+
data.tar.gz: 0409ad955e8eaf774ae88a7fc489711df4dd2b31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86ac879bf7cc6a68eb67f29206588e3ede7a5c47b548b6413a26a9d2c6b50a37118b078d5b0e96b63a5a1f9111bf358a9a5bccc70c3afadcfa6c1673d9d6319b
|
7
|
+
data.tar.gz: 2a68e39f0478eb078bd53fc30544c112c340011188fd3d2cde79c3118a4f45ee438f127e9044c7ec31e770e795ae2f1490ca2384540f8cd2ff3dc77d5da1d9fe
|
data/Gemfile.lock
CHANGED
@@ -1,30 +1,29 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dynamini (2.
|
4
|
+
dynamini (2.10.0)
|
5
5
|
activemodel (>= 3, < 5.0)
|
6
6
|
aws-sdk (~> 2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (4.2.
|
12
|
-
activesupport (= 4.2.
|
11
|
+
activemodel (4.2.5.1)
|
12
|
+
activesupport (= 4.2.5.1)
|
13
13
|
builder (~> 3.1)
|
14
|
-
activesupport (4.2.
|
14
|
+
activesupport (4.2.5.1)
|
15
15
|
i18n (~> 0.7)
|
16
|
+
json (~> 1.7, >= 1.7.7)
|
16
17
|
minitest (~> 5.1)
|
17
18
|
thread_safe (~> 0.3, >= 0.3.4)
|
18
19
|
tzinfo (~> 1.1)
|
19
|
-
aws-sdk (2.
|
20
|
-
aws-sdk-resources (= 2.
|
21
|
-
aws-sdk-core (2.
|
22
|
-
aws-sigv4 (~> 1.0)
|
20
|
+
aws-sdk (2.2.22)
|
21
|
+
aws-sdk-resources (= 2.2.22)
|
22
|
+
aws-sdk-core (2.2.22)
|
23
23
|
jmespath (~> 1.0)
|
24
|
-
aws-sdk-resources (2.
|
25
|
-
aws-sdk-core (= 2.
|
26
|
-
|
27
|
-
builder (3.2.3)
|
24
|
+
aws-sdk-resources (2.2.22)
|
25
|
+
aws-sdk-core (= 2.2.22)
|
26
|
+
builder (3.2.2)
|
28
27
|
coderay (1.1.0)
|
29
28
|
diff-lcs (1.2.5)
|
30
29
|
ffi (1.9.10)
|
@@ -49,14 +48,15 @@ GEM
|
|
49
48
|
guard-shell (0.7.1)
|
50
49
|
guard (>= 2.0.0)
|
51
50
|
guard-compat (~> 1.0)
|
52
|
-
i18n (0.
|
53
|
-
jmespath (1.3
|
51
|
+
i18n (0.7.0)
|
52
|
+
jmespath (1.1.3)
|
53
|
+
json (1.8.3)
|
54
54
|
listen (3.0.3)
|
55
55
|
rb-fsevent (>= 0.9.3)
|
56
56
|
rb-inotify (>= 0.9)
|
57
57
|
lumberjack (1.0.9)
|
58
58
|
method_source (0.8.2)
|
59
|
-
minitest (5.
|
59
|
+
minitest (5.8.4)
|
60
60
|
nenv (0.2.0)
|
61
61
|
notiffany (0.0.8)
|
62
62
|
nenv (~> 0.1)
|
@@ -85,8 +85,8 @@ GEM
|
|
85
85
|
shellany (0.0.1)
|
86
86
|
slop (3.6.0)
|
87
87
|
thor (0.19.1)
|
88
|
-
thread_safe (0.3.
|
89
|
-
tzinfo (1.2.
|
88
|
+
thread_safe (0.3.5)
|
89
|
+
tzinfo (1.2.2)
|
90
90
|
thread_safe (~> 0.1)
|
91
91
|
|
92
92
|
PLATFORMS
|
@@ -99,6 +99,3 @@ DEPENDENCIES
|
|
99
99
|
guard-shell
|
100
100
|
pry (~> 0)
|
101
101
|
rspec (~> 3)
|
102
|
-
|
103
|
-
BUNDLED WITH
|
104
|
-
1.16.0.pre.2
|
data/dynamini.gemspec
CHANGED
data/lib/dynamini/attributes.rb
CHANGED
@@ -49,6 +49,17 @@ module Dynamini
|
|
49
49
|
save!
|
50
50
|
end
|
51
51
|
|
52
|
+
def handled_attributes
|
53
|
+
attributes.each_with_object({}) do |(attribute_name, _value), result|
|
54
|
+
result[attribute_name.to_sym] = send(attribute_name.to_sym)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def inspect
|
59
|
+
attrib_string = handled_attributes.map { |(a, v)| "#{a}: #{v.inspect}" }.join(', ')
|
60
|
+
"#<#{self.class} #{attrib_string}>"
|
61
|
+
end
|
62
|
+
|
52
63
|
private
|
53
64
|
|
54
65
|
def attribute_updates
|
@@ -239,4 +239,18 @@ describe Dynamini::Attributes do
|
|
239
239
|
end
|
240
240
|
end
|
241
241
|
end
|
242
|
+
|
243
|
+
describe '#handled_attributes' do
|
244
|
+
it 'returns a hash of attributes with type conversion applied' do
|
245
|
+
expect(model.handled_attributes).to eq(
|
246
|
+
name: "Widget", price: 9.99, id: "abcd1234", hash_key: "009", things: Set.new([1, 2, 3]), stuff: [4, 5, 6]
|
247
|
+
)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
describe '#inspect' do
|
252
|
+
it 'serializes the class name and the handled attributes' do
|
253
|
+
expect(model.inspect).to eq('#<HandledModel name: "Widget", price: 9.99, id: "abcd1234", hash_key: "009", things: #<Set: {1, 2, 3}>, stuff: [4, 5, 6]>')
|
254
|
+
end
|
255
|
+
end
|
242
256
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamini
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Ward
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2017-09-
|
18
|
+
date: 2017-09-18 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activemodel
|