evnt 2.1.2 → 2.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/evnt/validator.rb +14 -0
- data/lib/evnt/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: 28c0022c15250f518920a8f8e236910a4a662b99
|
4
|
+
data.tar.gz: a05ee20f2363290ee092a04cbd1bb8f51891d0ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75a4217bd3abf0e4f38282f5d754b85c63fa6f6f7491b88da2a79553e4af482eaa650d348f5a27748da054b9300ec2c5d6fda18f12499d4109a9aac57856e65f
|
7
|
+
data.tar.gz: 7f3136bd5757a8175fe056a321050c36afb68907eab11ce3c79434bd14bf253830604d1c052c4009f94530e09518e08aa71be3b6e87cb398d31a4215869bf7ad
|
data/lib/evnt/validator.rb
CHANGED
@@ -161,6 +161,8 @@ module Evnt
|
|
161
161
|
validates_type_hash(param)
|
162
162
|
when :array
|
163
163
|
validates_type_array(param)
|
164
|
+
when :date
|
165
|
+
validates_type_date(param)
|
164
166
|
else
|
165
167
|
raise 'Validator type option not accepted'
|
166
168
|
end
|
@@ -199,6 +201,18 @@ module Evnt
|
|
199
201
|
param.instance_of?(Array)
|
200
202
|
end
|
201
203
|
|
204
|
+
def validates_type_date(param)
|
205
|
+
is_date = param.instance_of?(Date)
|
206
|
+
return true if is_date
|
207
|
+
|
208
|
+
begin
|
209
|
+
Date.parse(param)
|
210
|
+
true
|
211
|
+
rescue StandardError
|
212
|
+
false
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
202
216
|
end
|
203
217
|
|
204
218
|
end
|
data/lib/evnt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evnt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ideonetwork
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|