immosquare-extensions 0.1.22 → 0.1.24
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d4ded5cc647e8126d631f8ca563eef84565028fd6ce7a02b2c02cc7f8d6e5fa
|
4
|
+
data.tar.gz: 1d6d1a14217c893831fc42d213bd501dc3e5395495ccf374c57ab548f6cfd7f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76e11581eeb74ed8b42f24f224b9784ba5421efd926061dcb5e5aa2e71aa0940a4caf4478624a07d63e76b06be1f7b7f53f586052c472b08eeaec0158d148c42
|
7
|
+
data.tar.gz: 48b1920ad971819e4118cfa0d20dbd560cf1bad98394fa5ebb2277eb655ce9c8dcae8fe007b5065876a42b5dbb1616f32f196c1c886ec15d10a0ea7d0e2fb16a
|
@@ -10,16 +10,19 @@ class String
|
|
10
10
|
## Any other value will return nil.
|
11
11
|
##
|
12
12
|
## Examples:
|
13
|
-
## "true".to_boolean
|
14
|
-
## "false".to_boolean
|
15
|
-
## "random".to_boolean
|
13
|
+
## "true".to_boolean => true
|
14
|
+
## "false".to_boolean => false
|
15
|
+
## "random".to_boolean => nil
|
16
|
+
## "random".to_boolean(true) => true
|
16
17
|
##============================================================##
|
17
|
-
def to_boolean
|
18
|
+
def to_boolean(default_value = nil)
|
18
19
|
case downcase
|
19
20
|
when "true"
|
20
21
|
true
|
21
22
|
when "false"
|
22
23
|
false
|
24
|
+
else
|
25
|
+
default_value
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immosquare-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IMMO SQUARE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode_utils
|
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
requirements: []
|
65
|
-
rubygems_version: 3.5.
|
65
|
+
rubygems_version: 3.5.11
|
66
66
|
signing_key:
|
67
67
|
specification_version: 4
|
68
68
|
summary: Utility extensions for Ruby core classes
|