Why Ruby doesn't have a Boolean class
25-Jan-2019 2320
In some programming languages, true or false values are represented with a special data type called a Boolean. Others make do by using certain values of other data types to represent true and false. For instance, the integer 0 for “false” and the integer 1 for “true”.Ruby is a bit of an oddball in that while it has explicit values to represent true and false, there is no Boolean data type. Instead, in Ruby truth is represented by the sole instance of TrueClass, and falsehood is represented by the sole instance of FalseClass. TrueClass and FalseClass are both direct descendants of the Object class—they share no common Boolean parent class.
Why Ruby doesn't have a Boolean class #ruby #rubydeveloper #rubyonrails #doesn't #Boolean #class #class https://rubyonrails.ba/link/why-ruby-doesn-t-have-a-boolean-class