Class: MitakeApi::SMSProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/mitake_api/sms_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ SMSProvider

Returns a new instance of SMSProvider.



5
6
7
8
9
10
11
# File 'lib/mitake_api/sms_provider.rb', line 5

def initialize(settings)
  @settings = settings
  @url = settings[:url]
  @username = settings[:username]
  @password = settings[:password]
  @callback_url = settings[:callback_url]
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/mitake_api/sms_provider.rb', line 3

def message
  @message
end

#settingsObject (readonly)

Returns the value of attribute settings.



3
4
5
# File 'lib/mitake_api/sms_provider.rb', line 3

def settings
  @settings
end

Instance Method Details

#deliver!(message) ⇒ Object



13
14
15
16
17
# File 'lib/mitake_api/sms_provider.rb', line 13

def deliver!(message)
  @message = message
  client = Client.new(url: @url, username: @username, password: @password, callback_url: @callback_url)
  client.send_message(message)
end