class AnySMS::Response
Response
object. Generated on each AnySMS.send_sms
by backend implementations.
Attributes
meta[RW]
see initialize
status[R]
see initialize
Public Class Methods
new(status:, meta: nil)
click to toggle source
@param status [Symbol]
Status of sms request. Anything other than *:success* considered as failure.
@param meta [Hash]
Meta information which optionally can be returned by backend.
# File lib/any_sms/response.rb, line 14 def initialize(status:, meta: nil) @status = status @meta = meta end
Public Instance Methods
failed?()
click to toggle source
@return [Boolean] whether request has failed or not.
# File lib/any_sms/response.rb, line 25 def failed? !success? end
success?()
click to toggle source
@return [Boolean] whether request was succesful or not.
# File lib/any_sms/response.rb, line 20 def success? @status == :success end