Sha256: f435a52fd574349f0cb1a0135f2c1255d1388c2977b3db84cf3ea8b08c4391c7

Contents?: true

Size: 459 Bytes

Versions: 4

Compression:

Stored size: 459 Bytes

Contents

class Object
  def blank?
    respond_to?(:empty?) ? empty? : !self
  end

  def present?
    !blank?
  end
end

class NilClass
  def blank?
    true
  end
end

class FalseClass
  def blank?
    true
  end
end

class TrueClass
  def blank?
    false
  end
end

class Array
  alias_method :blank?, :empty?
end

class Hash
  alias_method :blank?, :empty?
end

class String
  def blank?
    self !~ /\S/
  end
end

class Numeric
  def blank?
    false
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
time_crisis-0.3.5 lib/time_crisis/support/ext/object/blank.rb
time_crisis-0.3.2 lib/time_crisis/support/ext/object/blank.rb
time_crisis-0.3.1 lib/time_crisis/support/ext/object/blank.rb
time_crisis-0.3.0 lib/time_crisis/support/ext/object/blank.rb