Class: ConvenientService::Utils::Bool::ToBool Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Bool::ToBool
- Defined in:
- lib/convenient_service/utils/bool/to_bool.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Converts objects to boolean. Implementation is very basic just to serve the need of this library. More comprehensive solution can be found in Rails, wannabe_bool, etc:
Instance Attribute Summary collapse
- #object ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ Boolean private
- #initialize(object) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(object) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/convenient_service/utils/bool/to_bool.rb', line 29 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/convenient_service/utils/bool/to_bool.rb', line 23 def object @object end |
Instance Method Details
#call ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/convenient_service/utils/bool/to_bool.rb', line 36 def call !!object end |