ratsit 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ratsit.rb +0 -1
- data/lib/ratsit/errors.rb +0 -1
- data/lib/ratsit/filter/filter.rb +1 -1
- data/lib/ratsit/request/request.rb +10 -10
- data/lib/ratsit/request/request_search_one_person.rb +6 -1
- data/lib/ratsit/request/token_request.rb +7 -3
- data/lib/ratsit/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a745bae2d09cce64f51efbb158ba616babb58718
         | 
| 4 | 
            +
              data.tar.gz: 1204ffd45d584c387699f07d5d7263703d24bf0c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5043b1c0fa0fe8d4bdb309e01c593a7834d2ef1114d48b7bba4b885be5a5cb4194cdfce8737fcc6b0aef1a3ff5f7f30ea383ac0ad114e202d0da8a605753e837
         | 
| 7 | 
            +
              data.tar.gz: 608c4711a901afc325f9bd3b60310c9d3cc8a44be51913e72e1b332cae315e732037a8e924e11030533c611fadae7e9e56798b9e036a24f90f91bef740906783
         | 
    
        data/lib/ratsit.rb
    CHANGED
    
    
    
        data/lib/ratsit/errors.rb
    CHANGED
    
    
    
        data/lib/ratsit/filter/filter.rb
    CHANGED
    
    
| @@ -31,18 +31,18 @@ module Ratsit | |
| 31 31 | 
             
                  end
         | 
| 32 32 |  | 
| 33 33 | 
             
                  def parseFilterArgs(args, filter_class)
         | 
| 34 | 
            -
             | 
| 34 | 
            +
                    if args.nil?
         | 
| 35 | 
            +
                      raise RatsitFilterError, 'Invalid args to function'
         | 
| 36 | 
            +
                    end
         | 
| 37 | 
            +
                    if args.instance_of?(filter_class)
         | 
| 38 | 
            +
                      return args
         | 
| 39 | 
            +
                    end
         | 
| 40 | 
            +
                    if args.is_a?(Hash)
         | 
| 41 | 
            +
                      return filter_class.new(args)
         | 
| 42 | 
            +
                    end
         | 
| 35 43 | 
             
                    raise RatsitFilterError, 'Invalid args to function'
         | 
| 36 44 | 
             
                  end
         | 
| 37 | 
            -
                  if args.instance_of?(filter_class)
         | 
| 38 | 
            -
                    return args
         | 
| 39 | 
            -
                  end
         | 
| 40 | 
            -
                  if args.is_a?(Hash)
         | 
| 41 | 
            -
                    return filter_class.new(args)
         | 
| 42 | 
            -
                  end
         | 
| 43 | 
            -
                  raise RatsitFilterError, 'Invalid args to function'
         | 
| 44 | 
            -
                end
         | 
| 45 45 |  | 
| 46 46 | 
             
                end
         | 
| 47 47 | 
             
              end
         | 
| 48 | 
            -
            end
         | 
| 48 | 
            +
            end
         | 
| @@ -27,7 +27,12 @@ module Ratsit | |
| 27 27 |  | 
| 28 28 | 
             
                  def response
         | 
| 29 29 | 
             
                    if response_ok
         | 
| 30 | 
            -
                       | 
| 30 | 
            +
                      puts @response.body
         | 
| 31 | 
            +
                      hits = @response.body[:search_one_person_response][:search_one_person_result][:ratsit_response_package][:person_search_result][:hits]
         | 
| 32 | 
            +
                      if hits.nil?
         | 
| 33 | 
            +
                        return nil
         | 
| 34 | 
            +
                      end
         | 
| 35 | 
            +
                      rsp = hits[:hit] || nil
         | 
| 31 36 | 
             
                      if rsp.nil?
         | 
| 32 37 | 
             
                        raise RatsitError, 'Invalid response from service'
         | 
| 33 38 | 
             
                      end
         | 
| @@ -18,9 +18,13 @@ module Ratsit | |
| 18 18 | 
             
                  def exec()
         | 
| 19 19 | 
             
                    begin
         | 
| 20 20 | 
             
                      # debug args: , log_level: :debug, log: true
         | 
| 21 | 
            -
                       | 
| 21 | 
            +
                      url = ENV['RATSIT_WSDL_URL']
         | 
| 22 | 
            +
                      if url.nil?
         | 
| 23 | 
            +
                        raise RatsitRequestError, 'Missing RATSIT_WSDL_URL in env'
         | 
| 24 | 
            +
                      end
         | 
| 25 | 
            +
                      client = Savon.client(wsdl: url)
         | 
| 22 26 | 
             
                      @response = client.call(@ept.underscore.to_sym, message: @filter_instance.to_obj)
         | 
| 23 | 
            -
                    rescue Savon::Error | 
| 27 | 
            +
                    rescue Savon::Error
         | 
| 24 28 | 
             
                      raise RatsitError, 'Provider error'
         | 
| 25 29 | 
             
                    end
         | 
| 26 30 | 
             
                  end
         | 
| @@ -32,4 +36,4 @@ module Ratsit | |
| 32 36 |  | 
| 33 37 | 
             
                end
         | 
| 34 38 | 
             
              end
         | 
| 35 | 
            -
            end
         | 
| 39 | 
            +
            end
         | 
    
        data/lib/ratsit/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ratsit
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Stefan Nyman
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016- | 
| 11 | 
            +
            date: 2016-10-12 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |