opto 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/opto/types/array.rb +1 -1
- data/lib/opto/types/boolean.rb +1 -1
- data/lib/opto/types/enum.rb +2 -3
- data/lib/opto/types/integer.rb +1 -1
- data/lib/opto/types/string.rb +1 -2
- data/lib/opto/types/uri.rb +1 -1
- data/lib/opto/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f08a0ec227631377b328f07f87e3b0ff2f1e2def
|
4
|
+
data.tar.gz: 3af3a7c0077be8a24f304789a14dfbc970162e0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb8f310f22ded339e110e98ca00d01f4f2922307ca3697b7c1dd4e989183fd160a3ecd123238d6abe0a9ca1d72981e001e1eb2ae2050f69cdb51ef76a35a81c7
|
7
|
+
data.tar.gz: c6472dfea318ad51b7c85148d66b63580216266d08fe0250ff1f1638a11033272635c47480bd872eb40af19c9b573507ad83a4c6c4d9a8ea758a8a2557a2d911
|
data/.travis.yml
CHANGED
data/lib/opto/types/array.rb
CHANGED
data/lib/opto/types/boolean.rb
CHANGED
data/lib/opto/types/enum.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require_relative '../type'
|
2
2
|
require 'opto/extensions/snake_case'
|
3
3
|
require 'opto/extensions/hash_string_or_symbol_key'
|
4
|
-
require 'opto/types/boolean'
|
5
4
|
|
6
5
|
module Opto
|
7
6
|
module Types
|
@@ -37,14 +36,14 @@ module Opto
|
|
37
36
|
class Enum < Opto::Type
|
38
37
|
using Opto::Extension::HashStringOrSymbolKey
|
39
38
|
|
40
|
-
OPTIONS
|
39
|
+
OPTIONS ||= {
|
41
40
|
options: [],
|
42
41
|
can_be_other: false,
|
43
42
|
in: []
|
44
43
|
}
|
45
44
|
|
46
45
|
true_when do |value|
|
47
|
-
|
46
|
+
!value.nil?
|
48
47
|
end
|
49
48
|
|
50
49
|
def initialize(options={})
|
data/lib/opto/types/integer.rb
CHANGED
data/lib/opto/types/string.rb
CHANGED
@@ -2,7 +2,6 @@ require_relative '../type'
|
|
2
2
|
require 'base64'
|
3
3
|
require 'opto/extensions/snake_case'
|
4
4
|
require 'opto/extensions/hash_string_or_symbol_key'
|
5
|
-
require 'opto/types/boolean'
|
6
5
|
|
7
6
|
module Opto
|
8
7
|
module Types
|
@@ -25,7 +24,7 @@ module Opto
|
|
25
24
|
|
26
25
|
TRANSFORMATIONS = [ :upcase, :downcase, :strip, :chomp, :capitalize ]
|
27
26
|
|
28
|
-
OPTIONS
|
27
|
+
OPTIONS ||= {
|
29
28
|
min_length: nil,
|
30
29
|
max_length: nil,
|
31
30
|
empty_is_nil: true,
|
data/lib/opto/types/uri.rb
CHANGED
data/lib/opto/version.rb
CHANGED