# # The class of the singleton object `true`. # # Several of its methods act as operators: # # * #& # * #| # * #=== # * #^ # # # One other method: # # * #to_s and its alias #inspect. # class TrueClass def !: () -> false # # Returns `false` if `object` is `false` or `nil`, `true` otherwise: # # true & Object.new # => true true & false # => false true & nil # # => false # def &: (false | nil) -> false | (untyped obj) -> bool # # Returns `true` or `false`. # # Like Object#==, if `object` is an instance of Object (and not an instance of # one of its many subclasses). # # This method is commonly overridden by those subclasses, to provide meaningful # semantics in `case` statements. # def ===: (true) -> true | (untyped obj) -> bool # # Returns `true` if `object` is `false` or `nil`, `false` otherwise: # # true ^ Object.new # => false # true ^ false # => true # true ^ nil # => true # def ^: (false | nil) -> true | (untyped obj) -> bool # # Returns string `'true'`: # # true.to_s # => "true" # # TrueClass#inspect is an alias for TrueClass#to_s. # alias inspect to_s # # Returns string `'true'`: # # true.to_s # => "true" # # TrueClass#inspect is an alias for TrueClass#to_s. # def to_s: () -> "true" # # Returns `true`: # # true | Object.new # => true # true | false # => true # true | nil # => true # # Argument `object` is evaluated. This is different from `true` with the # short-circuit operator, whose operand is evaluated only if necessary: # # true | raise # => Raises RuntimeError. # true || raise # => true # def |: (untyped obj) -> true end