evnt 3.1.0 → 3.1.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
  SHA256:
3
- metadata.gz: 0d27e279061c1fe5534475dff8473ebd99be75598bc1d107388cba8a6c5acf8f
4
- data.tar.gz: 794c7058bf25bdde40ade891d4fd8535ddddfbcf9b1c8baf5393bcfa9cf1c605
3
+ metadata.gz: 04e50930d63c06bea3e9210c6e509a570994198cd4dd2c5f966d3701720587e0
4
+ data.tar.gz: bff08e10f4ae1c9379ec1256d4302b2a3230e8a72d4809b7c1df789b2c7f8695
5
5
  SHA512:
6
- metadata.gz: 680ad444595d388a62fb4de5b8426487c5b7224775c249491ca5c9b15625ff148979ca7ae21391485524d58c617b7c2395072085ff9dc54c4b43bd61fb260ff6
7
- data.tar.gz: 89cf7a8bca1840914aa2338c9cc4e9b9e31d19e1e0327169f0de227161e57d6eecd2d380316d5665db2ccdbdf7fe3034ce3531f528eb30c2cb579f8316014075
6
+ metadata.gz: 3cc055a1e3886e9603395ea779589d410194c7e14585d9ad6ce586a7ebad9b1b3474feebaf8b58e475e431b22f5d6ca306154dab76c0d5b60fd8ab40e251a37b
7
+ data.tar.gz: a597ef9f651a5f2d8ce358264f4a0faa42f866653e7eda72fb5c5a2cbdca2691bc84080bda10d1b586f9710a2b3ab77173af18230c92309b0e13ea34569f9b4e
data/README.md CHANGED
@@ -34,6 +34,8 @@ Evnt is developed to be used over all kinds of projects and frameworks (like Rub
34
34
  - [Event](https://github.com/ideonetwork/evnt/blob/master/doc/Event.md)
35
35
  - [Handler](https://github.com/ideonetwork/evnt/blob/master/doc/Handler.md)
36
36
 
37
+ Every entity is a simple class that should be extended to structure your awesome project.
38
+
37
39
  ## Development
38
40
 
39
41
  To update the documentation run:
@@ -64,6 +64,7 @@ module Evnt
64
64
  end
65
65
 
66
66
  def _validates_custom
67
+ _validates_global_equal if @_result
67
68
  _validates_global_in if @_result
68
69
  _validates_global_out if @_result
69
70
 
@@ -71,6 +72,7 @@ module Evnt
71
72
  when :string
72
73
  _validates_string_blank if @_result
73
74
  _validates_string_length if @_result
75
+ _validates_string_regex if @_result
74
76
  when :integer
75
77
  _validates_number_min if @_result
76
78
  _validates_number_max if @_result
@@ -153,6 +155,11 @@ module Evnt
153
155
  # Global validations:
154
156
  ##########################################################################
155
157
 
158
+ def _validates_global_equal
159
+ return if @value.nil? || @_options[:equal].nil?
160
+ @_result = @_options[:equal] == @value
161
+ end
162
+
156
163
  def _validates_global_in
157
164
  return if @value.nil? || @_options[:in].nil?
158
165
  @_result = @_options[:in].include?(@value)
@@ -176,6 +183,11 @@ module Evnt
176
183
  @_result = @value.length == @_options[:length]
177
184
  end
178
185
 
186
+ def _validates_string_regex
187
+ return if @value.nil? || @_options[:regex].nil?
188
+ @_result = @value.match?(@_options[:regex])
189
+ end
190
+
179
191
  # Number validations:
180
192
  ##########################################################################
181
193
 
@@ -3,6 +3,6 @@
3
3
  # Evnt.
4
4
  module Evnt
5
5
 
6
- VERSION = '3.1.0'
6
+ VERSION = '3.1.1'
7
7
 
8
8
  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: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ideonetwork
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-19 00:00:00.000000000 Z
11
+ date: 2018-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler