Class: Chuanglan::International

Inherits:
Object
  • Object
show all
Defined in:
lib/chuanglan/international.rb

Constant Summary collapse

GATEWAY =
'https://intapi.253.com'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/chuanglan/international.rb', line 6

def password
  @password
end

.signatureObject

Returns the value of attribute signature.



6
7
8
# File 'lib/chuanglan/international.rb', line 6

def signature
  @signature
end

.timeoutObject

Returns the value of attribute timeout.



6
7
8
# File 'lib/chuanglan/international.rb', line 6

def timeout
  @timeout
end

.usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/chuanglan/international.rb', line 6

def username
  @username
end

Class Method Details

.send_to!(recipients, message, params = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/chuanglan/international.rb', line 8

def send_to!(recipients, message, params = {})
  params = base_params.merge(params)
  params[:da] = Array(recipients).join(',')
  params[:sm] = "#{params.delete(:signature) || signature}#{message}"
  rsp = Request.new("#{GATEWAY}/mt", params).perform
  success_or_raise_exception(rsp)
end