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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c25d89aba39253b82e542b1100d04dea62df0c6d
4
- data.tar.gz: 6dae5572e49c5eee2519de5b3e8a7d37bec27fda
3
+ metadata.gz: 82482dc1635528f6205cc3e32a9b45103bb0e877
4
+ data.tar.gz: 83fafa65a3df2863bc0466ab6d3cd92e2e440fbc
5
5
  SHA512:
6
- metadata.gz: 473a79775e34bfd9cd8d2fa15de5e8820b1560d711ee503f2a05bc790d5c29042d7c994c68e8120f88e509f6846e8acf3fa2eab643b2cd3d74f5aaba21ac11bf
7
- data.tar.gz: ca526a84eed486ca988d9fc1e5470d46fccf110234d75f5959822e69657b253657cbdb3e6ebf3e61d58a39317a56817d53d59b8ec0defd67deb47f7f69510e1f
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
 
@@ -22,7 +22,7 @@ module SimpleObjects
22
22
  end
23
23
 
24
24
  def hashed_values
25
- attributes.each_with_object({}) do |k, hsh|
25
+ attributes.each_with_object({}) do |(k, _), hsh|
26
26
  val = send(k)
27
27
  # `nil.to_h` => {} which we do not want
28
28
  if val.nil?
@@ -1,3 +1,3 @@
1
1
  module SimpleObjects
2
- VERSION = '1.0'
2
+ VERSION = '1.1'
3
3
  end
@@ -4,17 +4,14 @@ module SimpleObjects
4
4
  describe Serialization do
5
5
 
6
6
  class ExampleSerialization
7
- include Serialization
7
+ include Base
8
8
 
9
- attr_accessor :one, :two
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
- it 'will call .to_h' do
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.0'
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-12 00:00:00.000000000 Z
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: