Class: SmsGateway::Adapters::BetterOpener

Inherits:
Object
  • Object
show all
Defined in:
lib/better_opener/sms_gateway_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ BetterOpener

Returns a new instance of BetterOpener.



8
9
10
11
# File 'lib/better_opener/sms_gateway_adapter.rb', line 8

def initialize(config={})
  @config = {:from => SmsGateway::Base.from }
  @config.merge!(config)
end

Instance Method Details

#send_sms(sms) ⇒ Object



13
14
15
16
# File 'lib/better_opener/sms_gateway_adapter.rb', line 13

def send_sms(sms)
  options = @config.merge({:to => sms.to, :message => sms.text })  
  ::BetterOpener.add_notification("sms", sms.from, ::BetterOpener.render_sms('sms', sms) )
end