Method: TextBelt.text
- Defined in:
- lib/textbelt.rb
.text(phone_number, message, country = 'US') ⇒ Boolean
Get a list of categories from the service
41 42 43 44 45 46 47 48 |
# File 'lib/textbelt.rb', line 41 def text(phone_number, , country = 'US') PhoneValidator.validate(phone_number, country) uri = TextUtils.uri_for(country) res = Net::HTTP.post_form(uri, number: phone_number, message: ) body = JSON.parse(res.body) ResponseValidator.validate(phone_number, body) body['success'.freeze] end |