Sha256: 840e79aa64b8b6478c5f951e9af7fbeeaf1f17714d67775a0d24eedd86cf435c

Contents?: true

Size: 300 Bytes

Versions: 9

Compression:

Stored size: 300 Bytes

Contents

class Object
  def blank?
    if respond_to?(:empty?)
      nil? || empty?
    else
      nil?
    end
  end
  
  
  def to_query(key)
    require 'cgi' unless defined?(CGI) && defined?(CGI::escape)
    "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}"
  end
  
  def to_param
    to_s
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dribble-0.1.3 lib/core_ext/object.rb
dribble-0.1.2 lib/core_ext/object.rb
dribble-0.1.1 lib/core_ext/object.rb
dribble-0.1.0 lib/core_ext/object.rb
dribble-0.0.31 lib/core_ext/object.rb
dribble-0.0.3 lib/core_ext/object.rb
dribble-0.0.25 lib/core_ext/object.rb
dribble-0.0.2 lib/core_ext/object.rb
dribble-0.0.1 lib/core_ext/object.rb