Class: Xiaomi::Push::Services::Job
- Inherits:
-
Object
- Object
- Xiaomi::Push::Services::Job
- Defined in:
- lib/xiaomi/push/services/job.rb
Overview
定时任务类 API
Instance Attribute Summary collapse
-
#context ⇒ Client
The current value of context.
Instance Method Summary collapse
-
#destory(job_id) ⇒ Hash
删除定时任务.
-
#exist?(job_id) ⇒ Hash
检测定时任务是否存在.
-
#initialize(context) ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize(context) ⇒ Job
Returns a new instance of Job.
12 13 14 |
# File 'lib/xiaomi/push/services/job.rb', line 12 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Client
Returns the current value of context.
9 10 11 |
# File 'lib/xiaomi/push/services/job.rb', line 9 def context @context end |
Instance Method Details
#destory(job_id) ⇒ Hash
删除定时任务
29 30 31 32 |
# File 'lib/xiaomi/push/services/job.rb', line 29 def destory(job_id) url = @context.build_uri('schedule_job/delete') @context.post(url, { job_id: job_id }) end |
#exist?(job_id) ⇒ Hash
检测定时任务是否存在
20 21 22 23 |
# File 'lib/xiaomi/push/services/job.rb', line 20 def exist?(job_id) url = @context.build_uri('schedule_job/exist') @context.post(url, { job_id: job_id }) end |