Class: Africansms::Client
- Inherits:
-
Object
- Object
- Africansms::Client
- Defined in:
- lib/africansms/client.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params) ⇒ Client
constructor
A new instance of Client.
- #send_message ⇒ Object
Constructor Details
#initialize(params) ⇒ Client
Returns a new instance of Client.
7 8 9 |
# File 'lib/africansms/client.rb', line 7 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/africansms/client.rb', line 5 def params @params end |
Instance Method Details
#send_message ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/africansms/client.rb', line 11 def raise(AfricansmsError, 'The message to send should not be empty') unless response = RestClient.post(base_url, request_params, request_header) response.body rescue StandardError => e e end |