Sha256: 1ac3d3ce493713f849a11ced1d54d194db759556c36482645d3eaf91f1081e5f

Contents?: true

Size: 514 Bytes

Versions: 17

Compression:

Stored size: 514 Bytes

Contents

# == Synopsis
# add a blank? method to all Objects
class Object
  my_extension("blank?") do
    # return asserted if object is nil or empty
    def blank?
      result = nil?
      unless result
        if respond_to? 'empty?'
          if respond_to? 'strip'
            result = strip.empty?
          else
            if respond_to? 'compact'
              result = compact.empty?
            else
              result = empty?
            end
          end
        end
      end
      result
    end
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
royw-dvdprofiler2xbmc-0.0.15 lib/object_extensions.rb
royw-dvdprofiler2xbmc-0.0.17 lib/object_extensions.rb
royw-dvdprofiler2xbmc-0.0.18 lib/object_extensions.rb
royw-dvdprofiler2xbmc-0.0.19 lib/object_extensions.rb
royw-dvdprofiler_collection-0.0.3 lib/object_extensions.rb
royw-dvdprofiler_collection-0.1.0 lib/object_extensions.rb
royw-dvdprofiler_collection-0.1.1 lib/object_extensions.rb
royw-dvdprofiler_collection-0.1.2 lib/object_extensions.rb
royw-imdb-0.1.0 lib/object_extensions.rb
royw-imdb-0.1.1 lib/object_extensions.rb
royw-imdb-0.1.2 lib/object_extensions.rb
royw-tmdb-0.1.0 lib/object_extensions.rb
royw-tmdb-0.1.1 lib/object_extensions.rb
royw-tmdb-0.1.2 lib/object_extensions.rb
royw-tmdb-0.1.3 lib/object_extensions.rb
royw-tmdb-0.1.4 lib/object_extensions.rb
royw-tmdb-0.1.5 lib/object_extensions.rb