Blame view

lib/syspro/logoff.rb 350 Bytes
dc8aa5b6   Joe Weakley   Rubocop corrections
1
2
  # frozen_string_literal: true
  
3d0157a5   Isaac Lewis   add logoff
3
4
5
  module Syspro
    class Logoff < ApiResource
      def self.logoff(user_id)
dc8aa5b6   Joe Weakley   Rubocop corrections
6
7
        params = { 'UserId' => user_id }
        resp = request(:get, resource_url, params)
3d0157a5   Isaac Lewis   add logoff
8
  
dc8aa5b6   Joe Weakley   Rubocop corrections
9
        if resp[0].http_body == '0'
3d0157a5   Isaac Lewis   add logoff
10
11
12
13
14
15
16
          true
        else
          resp[0].http_body
        end
      end
  
      def resource_url
dc8aa5b6   Joe Weakley   Rubocop corrections
17
        '/Logoff'
3d0157a5   Isaac Lewis   add logoff
18
19
20
      end
    end
  end