Class: Parameters::Types::Boolean Private
- Defined in:
- lib/parameters/types/boolean.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.
Class Method Summary collapse
-
.===(value) ⇒ ::Boolean
private
Determine if the value is a Boolean.
-
.coerce(value) ⇒ true, false
private
Coerces the value into a Boolean.
- .type ⇒ true private
Methods inherited from Type
#<, #<=, #==, #===, #coerce, #to_ruby, to_ruby
Class Method Details
.===(value) ⇒ ::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.
Determine if the value is a Boolean.
23 24 25 |
# File 'lib/parameters/types/boolean.rb', line 23 def self.===(value) (value == true) || (value == false) end |
.coerce(value) ⇒ true, false
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.
Coerces the value into a Boolean.
36 37 38 39 40 41 42 43 |
# File 'lib/parameters/types/boolean.rb', line 36 def self.coerce(value) case value when FalseClass, 'false', :false false else true end end |
.type ⇒ true
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.
10 11 12 |
# File 'lib/parameters/types/boolean.rb', line 10 def self.type true end |