Module: SMSFu
- Defined in:
- lib/sms_fu.rb
Overview
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Defined Under Namespace
Classes: SMSFuException
Constant Summary collapse
- RAILS_CONFIG_ROOT =
defined?(RAILS_ROOT) ? "#{RAILS_ROOT}/config" : "#{File.dirname(__FILE__)}/../templates"
Class Method Summary collapse
Instance Method Summary collapse
- #deliver_sms(number, carrier, message, options = {}) ⇒ Object
- #get_sms_address(number, carrier) ⇒ Object
Class Method Details
.carriers ⇒ Object
29 30 31 |
# File 'lib/sms_fu.rb', line 29 def self.carriers @@carriers.dup end |
Instance Method Details
#deliver_sms(number, carrier, message, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/sms_fu.rb', line 33 def deliver_sms(number,carrier,,={}) number = format_number(number) raise SMSFuException.new("Cannot deliver an empty message to #{number}") if .nil? or .empty? [:limit] ||= .length = [0..[:limit]-1] sms_email = determine_sms_email(format_number(number),carrier) SmsNotifier.(sms_email,) rescue SMSFuException => exception raise exception end |
#get_sms_address(number, carrier) ⇒ Object
46 47 48 49 |
# File 'lib/sms_fu.rb', line 46 def get_sms_address(number,carrier) number = format_number(number) determine_sms_email(number,carrier) end |