1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/nilclass.rb

26 lines
297 B
Ruby
Raw Normal View History

class NilClass
#
# call-seq:
# nil.to_i -> 0
#
# Always returns zero.
#
# nil.to_i #=> 0
#
def to_i
return 0
end
#
# call-seq:
# nil.to_f -> 0.0
#
# Always returns zero.
#
# nil.to_f #=> 0.0
#
def to_f
return 0.0
end
end