Sha256: 60fa04795c10ea20077bf19459a1c77e29658f30f1d5d3d42ea80b71eb0246eb

Contents?: true

Size: 440 Bytes

Versions: 15

Compression:

Stored size: 440 Bytes

Contents

# == Synopsis
# add a blank? method to all Objects
class Object
  # return asserted if object is nil or empty
  # TODO: not the safest coding, probably should dup before stripping.  Maybe should also compact
  def blank?
    result = nil?
    unless result
      if respond_to? 'empty?'
        if respond_to? 'strip'
          result = strip.empty?
        else
          result = empty?
        end
      end
    end
    result
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
royw-imdb-0.0.10 lib/object_extensions.rb
royw-imdb-0.0.11 lib/object_extensions.rb
royw-imdb-0.0.12 lib/object_extensions.rb
royw-imdb-0.0.13 lib/object_extensions.rb
royw-imdb-0.0.14 lib/object_extensions.rb
royw-imdb-0.0.15 lib/object_extensions.rb
royw-imdb-0.0.16 lib/object_extensions.rb
royw-imdb-0.0.17 lib/object_extensions.rb
royw-imdb-0.0.19 lib/object_extensions.rb
royw-imdb-0.0.20 lib/object_extensions.rb
royw-imdb-0.0.21 lib/object_extensions.rb
royw-imdb-0.0.8 lib/object_extensions.rb
royw-imdb-0.0.9 lib/object_extensions.rb
royw-tmdb-0.0.1 lib/object_extensions.rb
royw-tmdb-0.0.2 lib/object_extensions.rb