Sha256: d765a95d93afe8ff5b71d24a24f7384d60c062dd3dbe31dc279a6e1a9f241744

Contents?: true

Size: 419 Bytes

Versions: 26

Compression:

Stored size: 419 Bytes

Contents

class NilClass #:nodoc:
  def blank?
    true
  end
  alias_method :empty?, :blank?
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
  if !"".respond_to? :blank
    def blank?
      self !~ /\S/
    end
  end
end  


Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
sugar-high-0.6.1 lib/sugar-high/blank.rb
sugar-high-0.6.0 lib/sugar-high/blank.rb
sugar-high-0.5.5 lib/sugar-high/blank.rb
sugar-high-0.5.4 lib/sugar-high/blank.rb
sugar-high-0.5.3 lib/sugar-high/blank.rb
sugar-high-0.5.1 lib/sugar-high/blank.rb
sugar-high-0.5.0 lib/sugar-high/blank.rb
sugar-high-0.4.9.5 lib/sugar-high/blank.rb
sugar-high-0.4.9.3 lib/sugar-high/blank.rb
sugar-high-0.4.9.2 lib/sugar-high/blank.rb
sugar-high-0.4.9.1 lib/sugar-high/blank.rb
sugar-high-0.4.9 lib/sugar-high/blank.rb
sugar-high-0.4.8 lib/sugar-high/blank.rb
sugar-high-0.4.7 lib/sugar-high/blank.rb
sugar-high-0.4.6.4 lib/sugar-high/blank.rb
sugar-high-0.4.6.3 lib/sugar-high/blank.rb
sugar-high-0.4.6.2 lib/sugar-high/blank.rb
sugar-high-0.4.6.1 lib/sugar-high/blank.rb
sugar-high-0.4.6 lib/sugar-high/blank.rb
sugar-high-0.4.5.2 lib/sugar-high/blank.rb