Sha256: 1212f688a298355a0ac157b9b8341040bef34987c679ea3c227ee8c4218460be

Contents?: true

Size: 462 Bytes

Versions: 52

Compression:

Stored size: 462 Bytes

Contents

class Object
  def blank?
    respond_to?(:empty?) ? empty? : !self
  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
  BLANK_RE = /\A[[:space:]]*\z/

  def blank?
    self =~ BLANK_RE
  end
end

class Numeric
  def blank?
    false
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
rundock-0.2.11 lib/rundock/ext/object/blank.rb
rundock-0.2.10 lib/rundock/ext/object/blank.rb
rundock-0.2.9 lib/rundock/ext/object/blank.rb
rundock-0.2.8 lib/rundock/ext/object/blank.rb
rundock-0.2.7 lib/rundock/ext/object/blank.rb
rundock-0.2.6 lib/rundock/ext/object/blank.rb
rundock-0.2.5 lib/rundock/ext/object/blank.rb
rundock-0.2.4 lib/rundock/ext/object/blank.rb
rundock-0.2.3 lib/rundock/ext/object/blank.rb
rundock-0.2.2 lib/rundock/ext/object/blank.rb
rundock-0.2.0 lib/rundock/ext/object/blank.rb
rundock-0.1.0 lib/rundock/ext/object/blank.rb