Posts

Showing posts from January, 2016

Integration of twilio into rails 4

Image
After some trial and error and much fumbling through online documentation, I managed to get the text notification functionality integrated into my Rails app. Here is a quick summary of the steps I took to get the Twilio API working. I hope that this document will help other developers navigate through the setup process much quicker than I did. Step 1 – Create a Twilio Dev Account You will need a Twilio test account to test your application. There is no charge for the test account and you get a free number to validate your voice or texting application. The account setup process is very straightforward and is explained very well in this video. The speaker does a thorough job walking you through the setup. You can choose the area code for your test number (and avoid long distance charges). You can even choose a number based on a set of letters. You will get an API SID and authorization token to configure your account in your Rails application. I used the Figaro ge

Difference between remove_method and undef_method

You can remove a method in two easy ways. The drastic Module #undef_method( ) removes all methods, including the inherited ones. The kinder Module #remove_method( ) removes the method from the receiver, but it leaves inherited methods alone. See below 2 simple example - Example 1 using undef_method class A def x puts "x from A class" end end class B < A def x puts "x from B Class" end undef_method : x end obj = B . new obj . x result : undefined method x' for # (NoMethodError) Example 2 using remove_method class A def x puts "x from A class" end end class B < A def x puts "x from B Class" end remove_method : x end obj = B . new obj . x x from A class