Class: TurbosmsRuby::Client

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

Constant Summary collapse

API_URL =
'https://api.turbosms.ua'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#method_nameObject

Returns the value of attribute method_name.



6
7
8
# File 'lib/turbosms_ruby/client.rb', line 6

def method_name
  @method_name
end

#module_nameObject

Returns the value of attribute module_name.



6
7
8
# File 'lib/turbosms_ruby/client.rb', line 6

def module_name
  @module_name
end

Instance Method Details

#send_message(phones, text) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/turbosms_ruby/client.rb', line 8

def send_message(phones,text)
  @module_name = 'message'
  @method_name = 'send.json'

  params = {
  recipients: phones,
  sms: {
      sender: ::TurbosmsRuby.config.sender,
      text: text
    }
  }
  response = post(params)
  JSON.parse(response.body)
end