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
Defined Under Namespace
Classes: AuthenticationError, Client, Configuration, Error, InvalidRequestError, Response, ServerError
Constant Summary collapse
- VERSION =
"2.0.0"
Class Method Summary collapse
-
.advanced_batch_send(messages, options = {}) ⇒ MitakeSms::Response+
Response object or array of response objects if batch was split.
-
.batch_send(messages, options = {}) ⇒ MitakeSms::Response+
Response object or array of response objects if batch was split.
-
.batch_send_with_limit(messages, limit = 500, options = {}) ⇒ MitakeSms::Response+
Response object or array of response objects if batch was split.
-
.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, charset: 'UTF8', **options) ⇒ MitakeSms::Response
Send a single SMS message.
Class Method Details
.advanced_batch_send(messages, options = {}) ⇒ MitakeSms::Response+
Returns response object or array of response objects if batch was split.
99 100 101 |
# File 'lib/mitake_sms.rb', line 99 def advanced_batch_send(, = {}) client.advanced_batch_send(, ) end |
.batch_send(messages, options = {}) ⇒ MitakeSms::Response+
Returns response object or array of response objects if batch was split.
69 70 71 |
# File 'lib/mitake_sms.rb', line 69 def batch_send(, = {}) client.batch_send_with_limit(, 500, ) end |
.batch_send_with_limit(messages, limit = 500, options = {}) ⇒ MitakeSms::Response+
Returns response object or array of response objects if batch was split.
81 82 83 |
# File 'lib/mitake_sms.rb', line 81 def batch_send_with_limit(, limit = 500, = {}) client.batch_send_with_limit(, limit, ) 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, charset: 'UTF8', **options) ⇒ MitakeSms::Response
Send a single SMS message
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/mitake_sms.rb', line 47 def send_sms(to:, text:, destname: nil, response_url: nil, client_id: nil, charset: 'UTF8', **) # Forward all parameters to the client method using named parameters client.send_sms( to: to, text: text, destname: destname, response_url: response_url, client_id: client_id, charset: charset, ** ) end |