super_mapper 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: 501af9967b955cc1ea2533f82d1f140fee9e473df6367e4e7d63dbbefa58e36d
4
- data.tar.gz: 77df68b13ca12927ce6cfc12c7e1ec2fb035036956abf22ff260d4cd5fdf77d1
3
+ metadata.gz: 92e1c7f01738548d461d348bc2f9786e90352de346d44624316f6fc8da250b12
4
+ data.tar.gz: 3467df91e630b1369d97fdc24132ff0614b3b1812c59001bc2b573c550c0886a
5
5
  SHA512:
6
- metadata.gz: 495659131760d9473a49605d5355d27a3902b380e7747ab6ce4361e2a323b18369a13e5f04c3d43df6cabce03f8a83ac3943ee3b7ab7a3f3e08f64103aa42fbf
7
- data.tar.gz: b0cab3d1991279fa3d8591d32c8198be44094911030bea4f5ad3ff3485b878a81362db0d20df4d2d46e9e2b5f0ef534da547b14621cbfbf642f8a936952429f3
6
+ metadata.gz: 1272db3b526112df424732eb66709e8c841f1ea8355afa49f7140381dcd3cbc26e47ba1eeb46b8f3c567e9e17fbf9f765f2a02dcc76b15f04474320698e9c230
7
+ data.tar.gz: 9928d4a08ae07b0ced6ac497d05c266a8fdadf0818d1dce9f04a5a68b3b79977db41e4c2b3a3d5b64469909a5fc791f3572c29db159f5a3c4cce17a84d84c7d1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- super_mapper (0.2.0)
4
+ super_mapper (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -22,6 +22,10 @@ class SuperMapper
22
22
  # @param [Object | Class] target the target object or class. If a class is given, it should have a no-args constructor since the new instance will be created calling +target.new+
23
23
  # @return [Object] the target object, or a new instance of the target class, filled with values coming from the source
24
24
  def map source, target
25
+ return if source.nil?
26
+
27
+ raise ArgumentError, 'target cannot be nil' if target.nil?
28
+
25
29
  target.is_a?(Class) ? map_object(source, target.new) : map_object(source, target)
26
30
  end
27
31
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class SuperMapper
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Joliveau
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-07 00:00:00.000000000 Z
11
+ date: 2019-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler