summaryrefslogtreecommitdiff
path: root/lib/chef/monkey_patches/numeric.rb
blob: 1f5ff14209e33d8d46837013ab340dd7d39dc036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
unless 0.respond_to?(:fdiv)
  class Numeric
    def fdiv(other)
      to_f / other
    end
  end
end

# String elements referenced with [] <= 1.8.6 return a Fixnum. Cheat to allow
# for the simpler "test"[2].ord construct
class Numeric 
  def ord
    return self
  end
end