Sha256: b19bfea306de42077773704878dfe4f3bd6d6363d441646643ca824bbe631c23

Contents?: true

Size: 515 Bytes

Versions: 19

Compression:

Stored size: 515 Bytes

Contents

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

19 entries across 19 versions & 3 rubygems

Version Path
kanamei-kanamei-keystone-0.0.12 lib/keystone/core_ext/blank.rb
kanamei-kanamei-keystone-0.0.13 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.11 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.12 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.14 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.15 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.16 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.17 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.18 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.19 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.20 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.21 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.22 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.23 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.24 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.25 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.26 lib/keystone/core_ext/blank.rb
kanamei-keystone-0.0.27 lib/keystone/core_ext/blank.rb
keystone-0.0.29 lib/keystone/core_ext/blank.rb