Class: Numeric
Instance Method Summary collapse
Instance Method Details
#to_bool ⇒ Object
2 3 4 5 6 |
# File 'lib/opium/extensions/numeric.rb', line 2 def to_bool return true if self == 1 return false if self == 0 raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") end |