Class: Porteo::Mensario_gateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/gateways/mensario_gateway.rb

Overview

Gateway to use Mensario service In Porteo this class acts as a link between SMS protocol and Mensario gem

This class inherits from Gateway and just overwrite the send_message method

Instance Method Summary collapse

Methods inherited from Gateway

connection_argument, #connection_arguments, #init_send, #initialize

Constructor Details

This class inherits a constructor from Porteo::Gateway

Instance Method Details

#send_message(msg) ⇒ nil

Send the SMS using Mensario gem

Parameters:

  • msg (Hash)

    The message sections to send

Returns:

  • (nil)


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/gateways/mensario_gateway.rb', line 43

def send_message( msg )

 Mensario.set_config do
   Mensario.license( @config[:license] )
   Mensario.username( @config[:username] )
   Mensario.password( @config[:password] )
 end
 Mensario.send_message( {:text => msg[:text],
                       :sender => msg[:sender],
                       :code => msg[:code], 
                       :phone => msg[:phone], 
                       :timezone => msg[:timezone],
                       :date => msg[:date] }
                      )

end