Blame view

lib/syspro/api_operations/logon.rb 611 Bytes
49716587   Isaac Lewis   refactor object s...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  require_relative "request"
  
  module Syspro
    module ApiOperations
      class Logon
        include ApiOperations::Request
  
        def logon(username, password, company_id, company_password = nil)
          params = {
            "Operator" => username,
            "OperatorPassword" => password,
            "CompanyId" => company_id,
            "CompanyPassword" => company_password
          }
          resp = self.request(:get, resource_url, params)
          user_id = UserIdObject.new(resp[0].http_body)
        end
  
        def resource_url
          "/Logon"
        end
  
3c0896d2   Isaac Lewis   change structs whops
23
        UserIdObject = Struct.new(:guid)
49716587   Isaac Lewis   refactor object s...
24
25
26
      end
    end
  end