immosquare-extensions 0.1.23 → 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: 91af3acbbe2b1313c50e33a5e8ea46d72cd756c6a1c0ccfa7485ecde04314088
4
- data.tar.gz: 0bf036b46ae962b1d1f66bff4bd8cae730025d9fe9e5c50cd722a6b857af4907
3
+ metadata.gz: 3d4ded5cc647e8126d631f8ca563eef84565028fd6ce7a02b2c02cc7f8d6e5fa
4
+ data.tar.gz: 1d6d1a14217c893831fc42d213bd501dc3e5395495ccf374c57ab548f6cfd7f2
5
5
  SHA512:
6
- metadata.gz: 268c1d4d83848181db652ad08a5ba3a5305c46deac76d3e550b6c8b7c7cd4ac327cb28d24251a110ef97b3abc9bb8af5f88d5c39df8223127dc18129e73c02f0
7
- data.tar.gz: 58f076b7d17fd17e04ffb2136f374395f7279ce53bcf8bc5b2d4a8ba85785cc9a4421e11eeedc79f8ac80be94e0c0f2538d0311b14a109270e3e1c101d957067
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 => true
14
- ## "false".to_boolean => false
15
- ## "random".to_boolean => nil
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
 
@@ -1,3 +1,3 @@
1
1
  module ImmosquareExtensions
2
- VERSION = "0.1.23".freeze
2
+ VERSION = "0.1.24".freeze
3
3
  end
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.23
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-05-07 00:00:00.000000000 Z
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.9
65
+ rubygems_version: 3.5.11
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Utility extensions for Ruby core classes