Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/heartwood/support/fixnum.rb
Instance Method Summary collapse
Instance Method Details
#nearest_half ⇒ Object
3 4 5 |
# File 'lib/heartwood/support/fixnum.rb', line 3 def nearest_half to_f.nearest_half end |
#to_bool ⇒ Object
7 8 9 10 11 |
# File 'lib/heartwood/support/fixnum.rb', line 7 def to_bool return true if self == 1 return false if self == 0 raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") end |