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

Returns:

  • (Boolean)


19
20
21
# File 'lib/riak/core_ext/blank.rb', line 19

def blank?
  false
end

#present?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/riak/core_ext/blank.rb', line 63

def present?
  !blank?
end

#to_json(*args) ⇒ Object



18
19
20
# File 'lib/riak/core_ext/json.rb', line 18

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

#to_paramObject



17
18
19
# File 'lib/riak/core_ext/to_param.rb', line 17

def to_param
  to_s
end

#to_query(key) ⇒ Object



21
22
23
24
# File 'lib/riak/core_ext/to_param.rb', line 21

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