virtus-mapper 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/virtus/mapper/version.rb +1 -1
- data/lib/virtus/mapper.rb +1 -1
- data/spec/virtus/mapper_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: 3d6d28f150fb62eacfa306509f4dcdd028c11aaf
|
4
|
+
data.tar.gz: 0be0b2f44a38c3d9e300fa5be1c1f43864723418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee0175a90dd63624ea349ee0605bc7b43bd501b37deb76bba392660106b370f42ab26c7ef0a00564e0593e834cc427ef2277fac662d1ce32636b1cac36d01918
|
7
|
+
data.tar.gz: 0497d8cdf327cfffdbba9f65cca6a12c3b12718751f8ca2747cddadd4e84caef7eb9f0ef568460c0beb13542685ebc1391cfa3a8f15b6ee02bf1dcb96839afc6
|
data/lib/virtus/mapper.rb
CHANGED
data/spec/virtus/mapper_spec.rb
CHANGED
@@ -18,6 +18,13 @@ module Virtus
|
|
18
18
|
default: '',
|
19
19
|
from: lambda { |atts| atts[:address][:street] rescue '' }
|
20
20
|
end
|
21
|
+
|
22
|
+
class Narwhal
|
23
|
+
include Virtus.model
|
24
|
+
include Virtus::Mapper
|
25
|
+
|
26
|
+
attribute :name, String, from: :narwhalmom
|
27
|
+
end
|
21
28
|
end
|
22
29
|
end
|
23
30
|
|
@@ -79,5 +86,12 @@ module Virtus
|
|
79
86
|
expect(mapper.last_name).to eq('Doe')
|
80
87
|
end
|
81
88
|
|
89
|
+
describe 'given no arguments to constructor' do
|
90
|
+
it 'does not raise error' do
|
91
|
+
expect {
|
92
|
+
Examples::Narwhal.new
|
93
|
+
}.not_to raise_error
|
94
|
+
end
|
95
|
+
end
|
82
96
|
end
|
83
97
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtus-mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RentPath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|