Sha256: 02c864132e8abcd9f106659030d0f12e6c8b2e749e9860a3295505d89676bc3d

Contents?: true

Size: 711 Bytes

Versions: 20

Compression:

Stored size: 711 Bytes

Contents

class Object
  unless instance_methods(false).include?("blank?")
    def blank?
      respond_to?(:empty?) ? empty? : !self
    end
  end
end

class String
  unless instance_methods(false).include?("blank?")
    def blank?
      self !~ /\S/
    end
  end
end

class Numeric
  unless instance_methods(false).include?("blank?")
    def blank?
      false
    end
  end
end

class TrueClass
  unless instance_methods(false).include?("blank?")
    def blank?
      false
    end
  end
end

class FalseClass
  unless instance_methods(false).include?("blank?")
    def blank?
      true
    end
  end
end

class NilClass
  unless instance_methods(false).include?("blank?")
    def blank?
      true
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
whyvalidationssuckin96-1.6.4 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.6.3 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.6.2 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.6.1 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.6.0 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.5.5 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.5.4 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.5.3 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.5.2 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.5.1 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.5.0 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.4.0 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.3.1 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.3.0 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.2.3 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.2.2 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.2.1 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.2.0 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.1.0 lib/whyvalidationssuckin96/ext/blank.rb
whyvalidationssuckin96-1.0.0 lib/whyvalidationssuckin96/ext/blank.rb