Sha256: 25bf7f10ab1f4aeaea2df624b8b8c754882fa8f708843e084a9546307512c0b4

Contents?: true

Size: 237 Bytes

Versions: 1

Compression:

Stored size: 237 Bytes

Contents

class NilClass

  def +(n)
    convert_to_match(n) + n
  end

  def to_bool
    false
  end

  private

    def convert_to_match(obj)
      return to_s if obj.is_a?(String)
      return to_i if obj.is_a?(Integer)
      to_f
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heartwood-0.0.1 lib/heartwood/support/nil_class.rb