Module: ActiveSMS
- Defined in:
- lib/active_sms.rb,
lib/active_sms/sending.rb,
lib/active_sms/version.rb,
lib/active_sms/configuration.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Backend Classes: Configuration, Response
Constant Summary collapse
- VERSION =
"0.2.0".freeze
Class Method Summary collapse
-
.config ⇒ ActiveSMS::Configuration
Object with configuration options.
-
.configure {|config| ... } ⇒ Object
Allows to configure ActiveSMS options and register backends.
-
.reset! ⇒ Object
resets ActiveSMS configuration to default.
-
.send_sms(phone, text, args = {}) ⇒ Object
Core of the gem, method responsible for sending sms.
Class Method Details
.config ⇒ ActiveSMS::Configuration
Returns object with configuration options.
4 5 6 |
# File 'lib/active_sms/configuration.rb', line 4 def self.config @@config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
Allows to configure ActiveSMS options and register backends
9 10 11 |
# File 'lib/active_sms/configuration.rb', line 9 def self.configure yield(config) end |
.reset! ⇒ Object
resets ActiveSMS configuration to default
14 15 16 |
# File 'lib/active_sms/configuration.rb', line 14 def self.reset! @@config = nil end |
.send_sms(phone, text, args = {}) ⇒ Object
Core of the gem, method responsible for sending sms
9 10 11 12 13 |
# File 'lib/active_sms/sending.rb', line 9 def send_sms(phone, text, args = {}) backend_name = args.delete(:backend) backend_class(backend_name).new(backend_params(backend_name)) .send_sms(phone, text) end |