Sha256: b77662f1323928c3e92d2ee10129f53bc181152cd66fe40f6795130bc666e3fd

Contents?: true

Size: 500 Bytes

Versions: 20

Compression:

Stored size: 500 Bytes

Contents

module RDStation
  class ErrorHandler
    class ExpiredCodeGrant
      attr_reader :errors

      ERROR_CODE = 'EXPIRED_CODE_GRANT'.freeze

      def initialize(errors)
        @errors = errors
      end

      def raise_error
        return if expired_code_errors.empty?
        raise RDStation::Error::ExpiredCodeGrant, expired_code_errors.first
      end

      private

      def expired_code_errors
        errors.select { |error| error['error_type'] == ERROR_CODE }
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rdstation-ruby-client-2.9.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.8.2 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.8.1 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.8.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.7.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.6.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.5.3 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.5.2 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.5.1 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.5.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.4.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.3.1 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.3.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.2.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.1.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-2.0.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-1.2.1 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-1.2.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-1.1.0 lib/rdstation/error_handler/expired_code_grant.rb
rdstation-ruby-client-1.0.1 lib/rdstation/error_handler/expired_code_grant.rb