actionizer 0.14.0 → 0.15.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
- SHA1:
3
- metadata.gz: d3ecc14e427eeabad9fe943e6851862f5eba03b5
4
- data.tar.gz: 5a7743d7834a23d01a09becae45a16454f5c3dba
2
+ SHA256:
3
+ metadata.gz: 4d7f51955ed2ca2b46445f35e2a8b60d8a8fdbc70025950ad2ed357ab32957c3
4
+ data.tar.gz: 52fa1c5738c0d4ec813e849b0113f80372d46ad27dbeb3b1b3ee8a732c2b1f16
5
5
  SHA512:
6
- metadata.gz: 7558cd11e7a5d4c263e1d39284cac1311968e8c95d779eafda3997c1089ee17664fc316c4247d402f3a2ac428ecfa3555bf53fc7e18df7fe0b2887e121dc00c2
7
- data.tar.gz: bf25a288061d5f91661252515c21b24f4f6848f90bdbf2709d73e1300794cf8211f5bd03d02cd87284e57e6de16984a00feb86dc2d8372446e00fbf74c83ca65
6
+ metadata.gz: 054a896f966b3dc40999a14e8425d427bf294733f85a6fd476ba3416b2fda3c96e3e88f10f1f4f667136a281265d916c55ee8c34afd6f191d28b08315079114d
7
+ data.tar.gz: 61a09c9ee3bc7bc64378cc039fc10bd600fe3b5c17685c8317315af6c8a1c77900f85ab1a91ef9c4bb8f155466635ab740f3b0f1a665255f7a5b83e4a55253b7
@@ -23,17 +23,18 @@ module Actionizer
23
23
  return "Param #{param} can't be nil"
24
24
  end
25
25
 
26
- type = attrs.fetch(:type)
26
+ if attrs.fetch(:required) && !params.include?(param)
27
+ return "Param #{param} is required for #{method_name}"
28
+ end
27
29
 
28
- # Type check if param was required, or if optional and passed in
29
- if attrs.fetch(:required) || params.include?(param)
30
- if type && !(params[param].class <= type)
31
- return "Param #{param} must descend from #{type}"
32
- end
30
+ if !params.include?(param)
31
+ next
33
32
  end
34
33
 
35
- if attrs.fetch(:required) && !params.include?(param)
36
- return "Param #{param} is required for #{method_name}"
34
+ type = attrs.fetch(:type)
35
+ param_class = params[param].is_a?(Class) ? params[param] : params[param].class
36
+ if type && !(param_class <= type)
37
+ return "Param #{param} must descend from #{type}"
37
38
  end
38
39
  end
39
40
 
@@ -1,3 +1,3 @@
1
1
  module Actionizer
2
- VERSION = '0.14.0'
2
+ VERSION = '0.15.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nichols
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-27 00:00:00.000000000 Z
11
+ date: 2019-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -154,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubyforge_project:
158
- rubygems_version: 2.6.11
157
+ rubygems_version: 3.0.1
159
158
  signing_key:
160
159
  specification_version: 4
161
160
  summary: Turn your classes into small, modular, reusable Actions