Class: FinchAPI::BooleanModel Abstract Private
- Inherits:
-
Object
- Object
- FinchAPI::BooleanModel
- Extended by:
- Converter
- Defined in:
- lib/finch-api/base_model.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.
Ruby has no Boolean class; this is something for models to refer to.
Class Method Summary collapse
- .==(other) ⇒ Boolean private
- .===(other) ⇒ Boolean private
- .coerce(value) ⇒ Boolean, Object private
- .dump(value) ⇒ Boolean, Object private
- .try_strict_coerce(value) ⇒ Array(true, Object, nil), Array(false, Boolean, Integer) private
Methods included from Converter
coerce, dump, try_strict_coerce, type_info
Class Method Details
.==(other) ⇒ 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.
242 |
# File 'lib/finch-api/base_model.rb', line 242 def self.==(other) = other.is_a?(Class) && other <= FinchAPI::BooleanModel |
.===(other) ⇒ 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.
237 |
# File 'lib/finch-api/base_model.rb', line 237 def self.===(other) = other == true || other == false |
.coerce(value) ⇒ Boolean, Object
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.
6 |
# File 'lib/finch-api/base_model.rb', line 6 def coerce(value) = super |
.dump(value) ⇒ Boolean, Object
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.
6 |
# File 'lib/finch-api/base_model.rb', line 6 def dump(value) = super |
.try_strict_coerce(value) ⇒ Array(true, Object, nil), Array(false, Boolean, Integer)
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.
266 267 268 269 270 271 272 273 |
# File 'lib/finch-api/base_model.rb', line 266 def try_strict_coerce(value) case value in true | false [true, value, 1] else [false, false, 0] end end |