gate 0.4.0 → 0.4.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: a99614096253f58fc609869e6b95d28a8643fbc2
4
- data.tar.gz: 0cec6ed9368095959790395fbc670ae2bb16e79f
3
+ metadata.gz: 534592273859c465d6782fd466fe95b2c3a43950
4
+ data.tar.gz: 0737964adad3f9807f9886faae5ebb28ca26a3e0
5
5
  SHA512:
6
- metadata.gz: 4c4148b37275f4fd92cf3303f407dbdc408506bd075e68447eb92d73a6359d5df91dc7c7fe19fce9887b90d9ab9cca53c3cb7997372a7c5394573087f360cd03
7
- data.tar.gz: cac664ec646262b832f802997938583a6b0d348cd7e8c96d7d1eea7c9daeb938790a64edabe2b9bc00bf04a48e5a0ef7cd9da4e21881ca99cf047863b74ec80f
6
+ metadata.gz: f974fec5ea5b17c290b3c018ef20b5e42469caafb206cc67912c1d400b2cbdc5902d6e6708e3cbf50a1f7356af1e55c97d6bf7e13d12bc5892bc3fb90c2fb5cd
7
+ data.tar.gz: 12d81ec727fd3f7063622daf3b4043f6fe5ba9d5ec51c186751932dce367e7c5a341bebfb854538df2b00a75e024c3fcf0f0c2e72f3fed595949071996786a42
@@ -1,5 +1,7 @@
1
1
  module Gate
2
2
  class Coercer
3
+ PRIMITIVES = [TrueClass, FalseClass, Array, Hash, Numeric]
4
+
3
5
  def initialize(engine, type, allow_nil: false)
4
6
  unless coercible?(type)
5
7
  fail CoercionError, "Doesn't know how to coerce into #{type}"
@@ -30,7 +32,7 @@ module Gate
30
32
 
31
33
  def detect_input_type(input)
32
34
  case input
33
- when TrueClass, FalseClass, Array, Hash, Any
35
+ when *PRIMITIVES, Any
34
36
  input.class
35
37
  else
36
38
  String
@@ -1,3 +1,3 @@
1
1
  module Gate
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Dudulski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2015-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coercible