Class: AlidayuSmsSender
- Inherits:
-
Object
- Object
- AlidayuSmsSender
- Defined in:
- lib/alidayu_sms.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
-
#template_code ⇒ Object
Returns the value of attribute template_code.
Instance Method Summary collapse
-
#batchSendSms(options = {}) ⇒ Object
发送短信.
-
#initialize(options = {}) ⇒ AlidayuSmsSender
constructor
A new instance of AlidayuSmsSender.
Constructor Details
#initialize(options = {}) ⇒ AlidayuSmsSender
Returns a new instance of AlidayuSmsSender.
22 23 24 25 26 27 28 29 30 |
# File 'lib/alidayu_sms.rb', line 22 def initialize( = {}) if load_config.present? && load_config[:alidayu].present? = load_config[:alidayu].merge() end = HashWithIndifferentAccess.new() check_system_params() @source = AlidayuSms::Alidayu.new() end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
20 21 22 |
# File 'lib/alidayu_sms.rb', line 20 def source @source end |
#template_code ⇒ Object
Returns the value of attribute template_code.
20 21 22 |
# File 'lib/alidayu_sms.rb', line 20 def template_code @template_code end |
Instance Method Details
#batchSendSms(options = {}) ⇒ Object
发送短信
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/alidayu_sms.rb', line 33 def batchSendSms( = {}) = HashWithIndifferentAccess.new() arr = %w(code product phones extend sms_free_sign_name sms_template_code) attr, flag = [], false arr.each do |a| flag = true unless [a] attr << [a] end check_params(flag, ) puts "传入参数为:#{attr}" @source.standard_send_msg(attr) end |