Class: SmsRu::Client::Models::Responses::SendSms

Inherits:
Base
  • Object
show all
Defined in:
lib/sms_ru/client/models/responses/send_sms.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

SUCCESS_STATUS =
'OK'.freeze

Instance Method Summary collapse

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/sms_ru/client/models/responses/send_sms.rb', line 24

def success?
  status == SUCCESS_STATUS
end

#to_errorObject



28
29
30
31
32
# File 'lib/sms_ru/client/models/responses/send_sms.rb', line 28

def to_error
  return if success?

  Error.new(status, code, text)
end