Class: ClickatellApiClient::API::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/clickatell_api_client/api/client.rb

Constant Summary collapse

NO_ERROR =
200
ERROR_MISSING_FROM_NUMBER =
106
ERROR_TOP_UP_ACCOUNT =
301
PROVIDER_URL =
'https://platform.clickatell.com'.freeze
MESSAGES_ENDPOINT =
'/messages'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Client

Returns a new instance of Client.



18
19
20
# File 'lib/clickatell_api_client/api/client.rb', line 18

def initialize(api_key)
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



16
17
18
# File 'lib/clickatell_api_client/api/client.rb', line 16

def api_key
  @api_key
end

Instance Method Details

#send_message(params) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/clickatell_api_client/api/client.rb', line 22

def send_message(params)
  request(
    http_method: :post,
    endpoint: MESSAGES_ENDPOINT,
    params: params
  )
end