Class: Object

Inherits:
BasicObject
Defined in:
lib/riak/core_ext/json.rb,
lib/riak/core_ext/blank.rb,
lib/riak/core_ext/blank.rb,
lib/riak/core_ext/to_param.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean



5
6
7
# File 'lib/riak/core_ext/blank.rb', line 5

def blank?
  false
end

#present?Boolean



49
50
51
# File 'lib/riak/core_ext/blank.rb', line 49

def present?
  !blank?
end

#to_json(*args) ⇒ Object



4
5
6
# File 'lib/riak/core_ext/json.rb', line 4

def to_json(*args)
  Riak::JSON.encode(self)
end

#to_paramObject



3
4
5
# File 'lib/riak/core_ext/to_param.rb', line 3

def to_param
  to_s
end

#to_query(key) ⇒ Object



7
8
9
10
# File 'lib/riak/core_ext/to_param.rb', line 7

def to_query(key)
  require 'cgi' unless defined?(CGI) && defined?(CGI::escape)
  "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}"
end