summaryrefslogtreecommitdiff
path: root/nilclass.rb
blob: 5a2e19680dcae9f32d4ac83772353d119caa26ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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