Class: XTwitterScraper::Internal::Type::Boolean Abstract Private
- Inherits:
-
Object
- Object
- XTwitterScraper::Internal::Type::Boolean
- Extended by:
- Converter, Util::SorbetRuntimeSupport
- Defined in:
- lib/x_twitter_scraper/internal/type/boolean.rb,
sig/x_twitter_scraper/internal/type/boolean.rbs
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
- .===(other) ⇒ Boolean
-
.coerce(value, state:) ⇒ Boolean, Object
private
Coerce value to Boolean if possible, otherwise return the original value.
- .dump(value, state:) ⇒ Boolean, Object private
- .to_sorbet_type ⇒ Object private
Methods included from Converter
coerce, dump, inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Util::SorbetRuntimeSupport
const_missing, define_sorbet_constant!, sorbet_constant_defined?, to_sorbet_type
Class Method Details
.==(other) ⇒ Boolean
33 |
# File 'lib/x_twitter_scraper/internal/type/boolean.rb', line 33 def self.==(other) = other.is_a?(Class) && other <= XTwitterScraper::Internal::Type::Boolean |
.===(other) ⇒ Boolean
26 |
# File 'lib/x_twitter_scraper/internal/type/boolean.rb', line 26 def self.===(other) = other == true || other == false |
.coerce(value, state:) ⇒ 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.
Coerce value to Boolean if possible, otherwise return the original value.
55 56 57 58 |
# File 'lib/x_twitter_scraper/internal/type/boolean.rb', line 55 def coerce(value, state:) state.fetch(:exactness)[value == true || value == false ? :yes : :no] += 1 value end |
.dump(value, state:) ⇒ 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.
|
|
# File 'lib/x_twitter_scraper/internal/type/boolean.rb', line 60
|
.to_sorbet_type ⇒ 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.
74 75 76 |
# File 'lib/x_twitter_scraper/internal/type/boolean.rb', line 74 def to_sorbet_type T::Boolean end |