Class: InceApi::CreateSms
- Inherits:
-
Object
- Object
- InceApi::CreateSms
- Defined in:
- lib/ince_api/create_sms.rb
Instance Method Summary collapse
-
#initialize(access_token:, iccid:, params: {}) ⇒ CreateSms
constructor
A new instance of CreateSms.
- #send ⇒ Object
Constructor Details
#initialize(access_token:, iccid:, params: {}) ⇒ CreateSms
Returns a new instance of CreateSms.
3 4 5 6 7 |
# File 'lib/ince_api/create_sms.rb', line 3 def initialize(access_token:, iccid:, params:{}) @access_token = access_token @iccid = iccid @params = params end |
Instance Method Details
#send ⇒ Object
9 10 11 12 |
# File 'lib/ince_api/create_sms.rb', line 9 def send response = connection.request(request) response.code.to_i == 201 ? allowed_params.merge(status: 'OK') : { status: 'FAILED', error_code: response.code.to_i} end |