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 +4 -4
- data/lib/gate/coercer.rb +3 -1
- data/lib/gate/version.rb +1 -1
- 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: 534592273859c465d6782fd466fe95b2c3a43950
|
4
|
+
data.tar.gz: 0737964adad3f9807f9886faae5ebb28ca26a3e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f974fec5ea5b17c290b3c018ef20b5e42469caafb206cc67912c1d400b2cbdc5902d6e6708e3cbf50a1f7356af1e55c97d6bf7e13d12bc5892bc3fb90c2fb5cd
|
7
|
+
data.tar.gz: 12d81ec727fd3f7063622daf3b4043f6fe5ba9d5ec51c186751932dce367e7c5a341bebfb854538df2b00a75e024c3fcf0f0c2e72f3fed595949071996786a42
|
data/lib/gate/coercer.rb
CHANGED
@@ -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
|
35
|
+
when *PRIMITIVES, Any
|
34
36
|
input.class
|
35
37
|
else
|
36
38
|
String
|
data/lib/gate/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coercible
|