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.5.4 lib/rundock/ext/object/blank.rb
rundock-0.5.3 lib/rundock/ext/object/blank.rb
rundock-0.5.2 lib/rundock/ext/object/blank.rb
rundock-0.5.0 lib/rundock/ext/object/blank.rb
rundock-0.4.16 lib/rundock/ext/object/blank.rb
rundock-0.4.15 lib/rundock/ext/object/blank.rb
rundock-0.4.14 lib/rundock/ext/object/blank.rb
rundock-0.4.13 lib/rundock/ext/object/blank.rb
rundock-0.4.12 lib/rundock/ext/object/blank.rb
rundock-0.4.11 lib/rundock/ext/object/blank.rb
rundock-0.4.10 lib/rundock/ext/object/blank.rb
rundock-0.4.8 lib/rundock/ext/object/blank.rb
rundock-0.4.7 lib/rundock/ext/object/blank.rb
rundock-0.4.6 lib/rundock/ext/object/blank.rb
rundock-0.4.4 lib/rundock/ext/object/blank.rb
rundock-0.4.3 lib/rundock/ext/object/blank.rb
rundock-0.4.2 lib/rundock/ext/object/blank.rb
rundock-0.4.1 lib/rundock/ext/object/blank.rb
rundock-0.4.0 lib/rundock/ext/object/blank.rb
rundock-0.3.0 lib/rundock/ext/object/blank.rb