Class: SemaphoreSMS::Client
- Inherits:
-
Object
- Object
- SemaphoreSMS::Client
show all
- Includes:
- HTTP
- Defined in:
- lib/semaphore_sms/client.rb
Constant Summary
collapse
- CONFIG_KEYS =
%i[
api_version
api_key
sender_name
uri_base
request_timeout
].freeze
Instance Method Summary
collapse
Methods included from HTTP
#get_request, #post_request
Constructor Details
#initialize(config = {}) ⇒ Client
Returns a new instance of Client.
15
16
17
18
19
|
# File 'lib/semaphore_sms/client.rb', line 15
def initialize(config = {})
CONFIG_KEYS.each do |key|
instance_variable_set("@#{key}", config[key] || SemaphoreSMS.configuration.send(key))
end
end
|
Instance Method Details
#account ⇒ Object
33
34
35
|
# File 'lib/semaphore_sms/client.rb', line 33
def account
@account ||= Resources::Account.new(self)
end
|
#messages ⇒ Object
21
22
23
|
# File 'lib/semaphore_sms/client.rb', line 21
def messages
@messages ||= Resources::Messages.new(self)
end
|
#otp ⇒ Object
29
30
31
|
# File 'lib/semaphore_sms/client.rb', line 29
def otp
@otp ||= Resources::Otp.new(self)
end
|
#priority ⇒ Object
25
26
27
|
# File 'lib/semaphore_sms/client.rb', line 25
def priority
@priority ||= Resources::Priority.new(self)
end
|