Sha256: bc5d1b09b43843055e0895b41ab74636b1a80907b052171a958511f191b5e8a0

Contents?: true

Size: 441 Bytes

Versions: 3

Compression:

Stored size: 441 Bytes

Contents

module IqSMS
  class RequestStatus
    def initialize(status, description)
      @status = status
      @description = description
    end

    def accepted?
      @status == 'ok'.freeze
    end

    def rejected?
      @status == 'error'.freeze
    end

    def auth_failed?
      rejected? && @description == 'error authorization'.freeze
    end

    def status_queue_empty?
      @description == 'queue is empty'.freeze
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iqsms-0.2.2 lib/iqsms/request_status.rb
iqsms-0.2.1 lib/iqsms/request_status.rb
iqsms-0.2.0 lib/iqsms/request_status.rb