Module: ToBe
- Defined in:
- lib/to_be.rb,
lib/to_be/truthy.rb,
lib/to_be/version.rb,
lib/to_be/internal/_str2bool.rb
Defined Under Namespace
Modules: Internal
Constant Summary collapse
- VERSION =
Current version of the ToBe.Ruby library
'0.0.2'
- VERSION_MAJOR =
Major version of the ToBe.Ruby library
VERSION_PARTS_[0]
- VERSION_MINOR =
Minor version of the ToBe.Ruby library
VERSION_PARTS_[1]
- VERSION_REVISION =
Revision version of the ToBe.Ruby library
VERSION_PARTS_[2]
Class Method Summary collapse
-
.string_falsey?(s) ⇒ Boolean
Indicates that the given string, when trimmed, is classified as “truthy” and is deemed as “falsey”.
-
.string_truey?(s) ⇒ Boolean
Indicates that the given string, when trimmed, is classified as “truthy” and is deemed as “truey”.
-
.string_truthy?(s) ⇒ Boolean
Indicates that the given string, when trimmed, is classified as “truthy” (and is deemed as either “falsey” or “truey”).
Instance Method Summary collapse
-
#str2bool(s) ⇒ Object
Determines the “truthy” nature of whether the given string is “truthy” and, if so, whether it is “falsey” or “truey”.
Class Method Details
.string_falsey?(s) ⇒ Boolean
Indicates that the given string, when trimmed, is classified as “truthy” and is deemed as “falsey”.
24 25 26 27 |
# File 'lib/to_be/truthy.rb', line 24 def string_falsey? s return false == ToBe::Internal::_str2bool(s) end |
Instance Method Details
#str2bool(s) ⇒ Object
Determines the “truthy” nature of whether the given string is “truthy” and, if so, whether it is “falsey” or “truey”.
Returns:
-
‘None` - string is not classified as “truthy”;
-
‘False` - string is classified as “truthy” and is deemed “falsey”;
-
‘True` - string is classified as “truthy” and is deemed “truey”;
17 18 19 20 |
# File 'lib/to_be/truthy.rb', line 17 def str2bool s ToBe::Internal::_str2bool s end |