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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e12573391086ba018391de63e2703189fa21f7bf
4
- data.tar.gz: b376a64d0723349675512b8e8d926dccaed3fa15
3
+ metadata.gz: 28c0022c15250f518920a8f8e236910a4a662b99
4
+ data.tar.gz: a05ee20f2363290ee092a04cbd1bb8f51891d0ea
5
5
  SHA512:
6
- metadata.gz: f5ee8bdee8f68cfde020eb0c08586ed534739917c034e569b77df8776f78098ce89aa6e183aaf3a72fa0dddbda6778b45bb2f1ca83bd8e3bd831cca79292f1ba
7
- data.tar.gz: c0cbbe7b83fa74c6088fb5297277b533327eaf2f730113a6e4a862e59c5c7f213984c4a7c5d1d65b1aabea474ee34be40937ce1a9a9fb0960ca5101a56697803
6
+ metadata.gz: 75a4217bd3abf0e4f38282f5d754b85c63fa6f6f7491b88da2a79553e4af482eaa650d348f5a27748da054b9300ec2c5d6fda18f12499d4109a9aac57856e65f
7
+ data.tar.gz: 7f3136bd5757a8175fe056a321050c36afb68907eab11ce3c79434bd14bf253830604d1c052c4009f94530e09518e08aa71be3b6e87cb398d31a4215869bf7ad
@@ -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
@@ -5,6 +5,6 @@ module Evnt
5
5
  ##
6
6
  # Constant containing the current gem version.
7
7
  ##
8
- VERSION = '2.1.2'
8
+ VERSION = '2.1.3'
9
9
 
10
10
  end
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.2
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-16 00:00:00.000000000 Z
11
+ date: 2017-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler