dynamini 2.9.6 → 2.10.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 394d8fc8fe9d1d1f6a0380d91009868d82eae552
4
- data.tar.gz: 3b831be32226ae1ccdbc2da1b7b11b2f9a5b3e56
3
+ metadata.gz: 550e30d31da4f4477173bed3f3bfdc2e2f2737c5
4
+ data.tar.gz: 0409ad955e8eaf774ae88a7fc489711df4dd2b31
5
5
  SHA512:
6
- metadata.gz: 4d1db9cfb9c089962b23c11204cc6ef9608a4eb46585d051f7d5a40856c40e49a5e9093546a3028d5a72f601930ee903f863d1bf56a2548df1430c59cf637c74
7
- data.tar.gz: f9e7a129e6f89b8588520392ccd5509deddf62e4aaaca493f9dca695732775d51a8e113c043f9b3bab8b8fb5aafc5ef5bbef82bc0e23c850cd4e5026002e9750
6
+ metadata.gz: 86ac879bf7cc6a68eb67f29206588e3ede7a5c47b548b6413a26a9d2c6b50a37118b078d5b0e96b63a5a1f9111bf358a9a5bccc70c3afadcfa6c1673d9d6319b
7
+ data.tar.gz: 2a68e39f0478eb078bd53fc30544c112c340011188fd3d2cde79c3118a4f45ee438f127e9044c7ec31e770e795ae2f1490ca2384540f8cd2ff3dc77d5da1d9fe
@@ -1,30 +1,29 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dynamini (2.9.6)
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.9)
12
- activesupport (= 4.2.9)
11
+ activemodel (4.2.5.1)
12
+ activesupport (= 4.2.5.1)
13
13
  builder (~> 3.1)
14
- activesupport (4.2.9)
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.10.45)
20
- aws-sdk-resources (= 2.10.45)
21
- aws-sdk-core (2.10.45)
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.10.45)
25
- aws-sdk-core (= 2.10.45)
26
- aws-sigv4 (1.0.2)
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.8.6)
53
- jmespath (1.3.1)
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.10.3)
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.6)
89
- tzinfo (1.2.3)
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'dynamini'
3
- s.version = '2.9.6'
3
+ s.version = '2.10.0'
4
4
  s.summary = 'DynamoDB interface'
5
5
  s.description = 'Lightweight DynamoDB interface gem designed as
6
6
  a drop-in replacement for ActiveRecord.
@@ -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.9.6
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-15 00:00:00.000000000 Z
18
+ date: 2017-09-18 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activemodel