Class: Aliyun::Cloudpush::Client
- Inherits:
-
Object
- Object
- Aliyun::Cloudpush::Client
- Defined in:
- lib/aliyun/cloudpush/client.rb
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
readonly
Returns the value of attribute access_key_id.
-
#access_key_secret ⇒ Object
readonly
Returns the value of attribute access_key_secret.
-
#app_key ⇒ Object
readonly
Returns the value of attribute app_key.
Instance Method Summary collapse
-
#initialize(app_key, access_key_id, access_key_secret) ⇒ Client
constructor
A new instance of Client.
- #push(employee_id, title, body, options = {}) ⇒ Object
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_id ⇒ Object (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_secret ⇒ Object (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_key ⇒ Object (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, = {}) params = { "TargetValue": employee_id, "Title": title, "Body": body, } http_post(default_push_params.merge(params).merge()) end |