simple_objects 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/simple_objects/serialization.rb +1 -1
- data/lib/simple_objects/version.rb +1 -1
- data/spec/lib/simple_objects/serialization_spec.rb +7 -9
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82482dc1635528f6205cc3e32a9b45103bb0e877
|
4
|
+
data.tar.gz: 83fafa65a3df2863bc0466ab6d3cd92e2e440fbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 028e3668de42f379beab28284abe6b98bed97e3da45446561686037f8ec6d9aaf88fde0c5c1624fbd3eeeea67021b33798466fbe3293d4e23a7a6e802edbd527
|
7
|
+
data.tar.gz: 9595843730d3b0bbe30afc0ed2ec68d0ac0873e6a3c1baa929744dc06e9657d6934a61b29c9049e4778b4890383a44a2ef2ae8d78ebdc5f522c3ad9afb276942
|
data/README.md
CHANGED
@@ -38,7 +38,7 @@ Feedback and fixes are always welcome. Please make use of [Issues](https://gith
|
|
38
38
|
|
39
39
|
## Author/Contact
|
40
40
|
|
41
|
-
SimpleObjects is written and maintained by [@doomspork](github.com/doomspork).
|
41
|
+
SimpleObjects is written and maintained by [@doomspork](http://github.com/doomspork).
|
42
42
|
|
43
43
|
## License
|
44
44
|
|
@@ -4,17 +4,14 @@ module SimpleObjects
|
|
4
4
|
describe Serialization do
|
5
5
|
|
6
6
|
class ExampleSerialization
|
7
|
-
include
|
7
|
+
include Base
|
8
8
|
|
9
|
-
|
9
|
+
attribute :one
|
10
|
+
attribute :two
|
10
11
|
|
11
12
|
def timestamp
|
12
13
|
Time.now
|
13
14
|
end
|
14
|
-
|
15
|
-
def attributes
|
16
|
-
[:one, :two]
|
17
|
-
end
|
18
15
|
end
|
19
16
|
|
20
17
|
describe '#to_h' do
|
@@ -47,17 +44,18 @@ module SimpleObjects
|
|
47
44
|
end
|
48
45
|
|
49
46
|
context 'with a collection' do
|
47
|
+
let(:example) { ExampleSerialization.new(one: [ExampleSerialization.new]) }
|
48
|
+
|
50
49
|
it 'will call .to_h on entries' do
|
51
|
-
example.one = [ExampleSerialization.new]
|
52
50
|
expect(subject[:one]).to be_a Array
|
53
51
|
expect(subject[:one].first).to include(:one, :two)
|
54
52
|
end
|
55
53
|
end
|
56
54
|
|
57
55
|
context 'with a value that responds to .to_h' do
|
58
|
-
|
59
|
-
example.one = ExampleSerialization.new
|
56
|
+
let(:example) { ExampleSerialization.new(one: ExampleSerialization.new) }
|
60
57
|
|
58
|
+
it 'will call .to_h' do
|
61
59
|
expect(subject[:one]).to include(:one, :two)
|
62
60
|
end
|
63
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Callan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -151,3 +151,4 @@ test_files:
|
|
151
151
|
- spec/lib/simple_objects/base_spec.rb
|
152
152
|
- spec/lib/simple_objects/serialization_spec.rb
|
153
153
|
- spec/spec_helper.rb
|
154
|
+
has_rdoc:
|