Class: ActionSms::ConnectionAdapters::AbstractAdapter
- Inherits:
-
Object
- Object
- ActionSms::ConnectionAdapters::AbstractAdapter
show all
- Defined in:
- lib/action_sms/connection_adapters/abstract_adapter.rb
Overview
All the concrete gateway adapters follow the interface laid down in this class. You can use this interface directly by borrowing the gateway connection from the Base with Base.connection.
Instance Method Summary
collapse
Constructor Details
11
12
13
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 11
def initialize(config = {})
@config = config
end
|
Instance Method Details
#authenticate(params) ⇒ Object
15
16
17
18
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 15
def authenticate(params)
params["authentication_key"] == @config[:authentication_key] ?
params.delete("authentication_key") : nil
end
|
#authentication_key ⇒ Object
24
25
26
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 24
def authentication_key
@config[:authentication_key]
end
|
#authentication_key=(value) ⇒ Object
20
21
22
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 20
def authentication_key=(value)
@config[:authentication_key] = value
end
|
#configuration ⇒ Object
28
29
30
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 28
def configuration
@config
end
|
#configuration=(value) ⇒ Object
32
33
34
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 32
def configuration=(value)
@config = value
end
|
#use_ssl ⇒ Object
36
37
38
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 36
def use_ssl
@config[:use_ssl]
end
|
#use_ssl=(value) ⇒ Object
40
41
42
|
# File 'lib/action_sms/connection_adapters/abstract_adapter.rb', line 40
def use_ssl=(value)
@config[:use_ssl] = value
end
|