Module: MitakeSms
- Defined in:
- lib/mitake_sms.rb,
lib/mitake_sms/client.rb,
lib/mitake_sms/version.rb,
lib/mitake_sms/response.rb,
lib/mitake_sms/configuration.rb,
sig/mitake_sms.rbs
Defined Under Namespace
Classes: AuthenticationError, Client, Configuration, Error, InvalidRequestError, Response, ServerError
Constant Summary collapse
- VERSION =
"3.0.0"
Class Method Summary collapse
-
.batch_send(messages, options = {}) ⇒ MitakeSms::Response+
Send multiple SMS messages in a single request The Mitake SMS API has a limit of 500 messages per request If more than 500 messages are provided, they will be automatically split into multiple requests.
-
.client ⇒ MitakeSms::Client
Create a new client with the current configuration.
-
.config ⇒ Object
Return the Dry::Configurable object directly.
-
.configure {|MitakeSms::Configuration| ... } ⇒ Object
Configure the gem.
-
.send_sms(to:, text:, destname: nil, response_url: nil, client_id: nil, **options) ⇒ MitakeSms::Response
Send a single SMS message.
Class Method Details
.batch_send(messages, options = {}) ⇒ MitakeSms::Response+
Send multiple SMS messages in a single request The Mitake SMS API has a limit of 500 messages per request If more than 500 messages are provided, they will be automatically split into multiple requests
66 67 68 |
# File 'lib/mitake_sms.rb', line 66 def batch_send(, = {}) client.batch_send(, ) end |
.client ⇒ MitakeSms::Client
Create a new client with the current configuration
34 35 36 |
# File 'lib/mitake_sms.rb', line 34 def client @client ||= Client.new end |
.config ⇒ Object
Return the Dry::Configurable object directly
28 29 30 |
# File 'lib/mitake_sms.rb', line 28 def config Configuration.config end |
.configure {|MitakeSms::Configuration| ... } ⇒ Object
Configure the gem
22 23 24 |
# File 'lib/mitake_sms.rb', line 22 def configure yield(config) if block_given? end |
.send_sms(to:, text:, destname: nil, response_url: nil, client_id: nil, **options) ⇒ MitakeSms::Response
Send a single SMS message
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/mitake_sms.rb', line 46 def send_sms(to:, text:, destname: nil, response_url: nil, client_id: nil, **) client.send_sms( to: to, text: text, destname: destname, response_url: response_url, client_id: client_id, ** ) end |