June 2017
Beginner
330 pages
7h 30m
English
This is going to be a fun section, as we are going to talk about sending an SMS message. Also, you will learn about how Ruby works with private and public methods.
Now, I'll go back to the ApiConnector class and create a class called SmsConnector that inherits from the ApiConnector class. In this class, I will create a method called send_sms. Inside this method, I'm going to place a code that will run a script that contacts an API that I created; it will look like this:
class SmsConnector < ApiConnector def send_sms `curl -X POST -d "notification[title]=#{@title}" -d "notification[url]=http://edutechional-resty.herokuapp.com/posts/1" "#{@url}"` endend
This method will send a title and link to an ...
Read now
Unlock full access