module NewUmeng::Util
Public Instance Methods
generate_sign(uri, params)
click to toggle source
# File lib/new_umeng/util.rb, line 3 def generate_sign(uri, params) method = 'POST' url = [NewUmeng::UMENG_HOST, '/', uri] post_body = JSON.dump(params) Digest::MD5.hexdigest([method, url, post_body, @app_master_secret].join) end
result(body, type)
click to toggle source
{“status”=>6, “total_count”=>0, “accept_count”=>0, “sent_count”=>0, “open_count”=>0, “dismiss_count”=>0}
# File lib/new_umeng/util.rb, line 11 def result(body, type) result = JSON.load(body) case type when 'api/send' body when 'api/status' body when 'api/cancel' body end end