Class: Aliyun::Cloudpush::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/aliyun/cloudpush/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_key, access_key_id, access_key_secret) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
# File 'lib/aliyun/cloudpush/client.rb', line 12

def initialize(app_key, access_key_id, access_key_secret)
  @access_key_id = access_key_id
  @access_key_secret = access_key_secret
  @app_key = app_key
end

Instance Attribute Details

#access_key_idObject (readonly)

Returns the value of attribute access_key_id.



10
11
12
# File 'lib/aliyun/cloudpush/client.rb', line 10

def access_key_id
  @access_key_id
end

#access_key_secretObject (readonly)

Returns the value of attribute access_key_secret.



10
11
12
# File 'lib/aliyun/cloudpush/client.rb', line 10

def access_key_secret
  @access_key_secret
end

#app_keyObject (readonly)

Returns the value of attribute app_key.



10
11
12
# File 'lib/aliyun/cloudpush/client.rb', line 10

def app_key
  @app_key
end

Instance Method Details

#push(employee_id, title, body, options = {}) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/aliyun/cloudpush/client.rb', line 18

def push(employee_id, title, body, options = {})
  params = {
    "TargetValue": employee_id,
    "Title": title,
    "Body": body,
  }
  http_post(default_push_params.merge(params).merge(options))
end