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-1.2.1 lib/rundock/ext/object/blank.rb
rundock-1.2.0 lib/rundock/ext/object/blank.rb
rundock-1.1.7 lib/rundock/ext/object/blank.rb
rundock-1.1.6 lib/rundock/ext/object/blank.rb
rundock-1.1.5 lib/rundock/ext/object/blank.rb
rundock-1.1.4 lib/rundock/ext/object/blank.rb
rundock-1.1.3 lib/rundock/ext/object/blank.rb
rundock-1.1.2 lib/rundock/ext/object/blank.rb
rundock-1.1.1 lib/rundock/ext/object/blank.rb
rundock-1.1.0 lib/rundock/ext/object/blank.rb
rundock-1.0.8 lib/rundock/ext/object/blank.rb
rundock-1.0.7 lib/rundock/ext/object/blank.rb
rundock-1.0.6 lib/rundock/ext/object/blank.rb
rundock-1.0.5 lib/rundock/ext/object/blank.rb
rundock-1.0.4 lib/rundock/ext/object/blank.rb
rundock-1.0.2 lib/rundock/ext/object/blank.rb
rundock-1.0.1 lib/rundock/ext/object/blank.rb
rundock-1.0.0 lib/rundock/ext/object/blank.rb
rundock-0.5.8 lib/rundock/ext/object/blank.rb
rundock-0.5.7 lib/rundock/ext/object/blank.rb