Sha256: 4232a5510d984bff590d1aef78a026a09fb939db3dd65223cabcfa347574cfd9

Contents?: true

Size: 232 Bytes

Versions: 2

Compression:

Stored size: 232 Bytes

Contents

unless (RUBY_VERSION[0,3] == '1.9')

  class NilClass

    # Allows <tt>nil</tt> to respond to #to_f.
    # Always returns <tt>0</tt>.
    #
    #   nil.to_f   #=> 0.0
    #
    #   CREDIT: Matz

    def to_f; 0.0; end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facets-2.4.2 lib/core/facets/nilclass/to_f.rb
facets-2.4.3 lib/core/facets/nilclass/to_f.rb