Module: Umeng::Services

Includes:
Util
Included in:
SendMessage
Defined in:
lib/umeng/services.rb

Instance Method Summary collapse

Methods included from Util

#generate_sign, #result

Instance Method Details

#cancel(task_id) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/umeng/services.rb', line 32

def cancel(task_id)
  uri = 'api/cancel'
  params = {
      appkey: @appkey,
      timestamp: Time.now.to_i,
      task_id: task_id
  }
  request(uri, params)
end

#push(params = {}) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/umeng/services.rb', line 9

def push(params={})
  uri = 'api/send'
  params.merge!({
    appkey: @appkey,
    timestamp: Time.now.to_i
  })
  request(uri, params)
end

#status(task_id) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/umeng/services.rb', line 20

def status(task_id)
  uri = 'api/status'
  params = {
    appkey: @appkey,
    timestamp: Time.now.to_i,
    task_id: task_id
  }
  request(uri, params)
end