Sha256: fe0474a2aa625abc2591980713bbabb4ef22ce4124af494b1825c00e01f671ca

Contents?: true

Size: 539 Bytes

Versions: 3

Compression:

Stored size: 539 Bytes

Contents

# -*- coding: utf-8 -*-
class Object
  # copy from activesupport
  def blank?
    respond_to?(:empty?) ? empty? : !self
  end
end

class NilClass #:nodoc:
  def blank?
    true
  end
end

class FalseClass #:nodoc:
  def blank?
    true
  end
end

class TrueClass #:nodoc:
  def blank?
    false
  end
end

class Array #:nodoc:
  alias_method :blank?, :empty?
end

class Hash #:nodoc:
  alias_method :blank?, :empty?
end

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

class Numeric #:nodoc:
  def blank?
    false
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
keystone-0.0.32 lib/keystone/core_ext/blank.rb
keystone-0.0.31 lib/keystone/core_ext/blank.rb
keystone-0.0.30 lib/keystone/core_ext/blank.rb