Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/init.rb
Instance Method Summary collapse
Instance Method Details
#to_bool ⇒ Object
10 11 12 13 14 |
# File 'lib/init.rb', line 10 def to_bool return true if self == 1 return false if self == 0 raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") end |