Class: Aliyun::CloudSms::Request::MessageSend
- Defined in:
- lib/aliyun/cloud_sms/request/message_send.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#mobile ⇒ Object
Returns the value of attribute mobile.
-
#optional_params ⇒ Object
Returns the value of attribute optional_params.
-
#template_code ⇒ Object
Returns the value of attribute template_code.
-
#template_param ⇒ Object
Returns the value of attribute template_param.
Attributes inherited from Base
Instance Method Summary collapse
- #action ⇒ Object
- #custom_params ⇒ Object
-
#initialize(mobile, template_code, template_param, optional_params = nil) ⇒ MessageSend
constructor
A new instance of MessageSend.
Methods inherited from Base
Constructor Details
#initialize(mobile, template_code, template_param, optional_params = nil) ⇒ MessageSend
Returns a new instance of MessageSend.
10 11 12 13 14 15 |
# File 'lib/aliyun/cloud_sms/request/message_send.rb', line 10 def initialize(mobile, template_code, template_param, optional_params = nil) self.mobile = mobile self.template_code = template_code self.template_param = template_param self.optional_params = optional_params || {} end |
Instance Attribute Details
#mobile ⇒ Object
Returns the value of attribute mobile.
8 9 10 |
# File 'lib/aliyun/cloud_sms/request/message_send.rb', line 8 def mobile @mobile end |
#optional_params ⇒ Object
Returns the value of attribute optional_params.
8 9 10 |
# File 'lib/aliyun/cloud_sms/request/message_send.rb', line 8 def optional_params @optional_params end |
#template_code ⇒ Object
Returns the value of attribute template_code.
8 9 10 |
# File 'lib/aliyun/cloud_sms/request/message_send.rb', line 8 def template_code @template_code end |
#template_param ⇒ Object
Returns the value of attribute template_param.
8 9 10 |
# File 'lib/aliyun/cloud_sms/request/message_send.rb', line 8 def template_param @template_param end |
Instance Method Details
#action ⇒ Object
17 18 19 |
# File 'lib/aliyun/cloud_sms/request/message_send.rb', line 17 def action "SendSms".freeze end |
#custom_params ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/aliyun/cloud_sms/request/message_send.rb', line 21 def custom_params self.template_param = self.template_param.to_json if self.template_param.is_a?(Hash) { :PhoneNumbers => self.mobile, :TemplateCode => self.template_code, :TemplateParam => self.template_param.to_s, }.merge!(self.optional_params) end |