Sha256: 7b33dc97e7c21d9383ad222cb2dcd70e27b7c84bd5c5556d198fd01efee5c533

Contents?: true

Size: 488 Bytes

Versions: 6

Compression:

Stored size: 488 Bytes

Contents

class Valvat
  module Lookup
    class Request
      def initialize(vat)
        @vat = vat
      end

      def perform(client)
        client.request(action) do |r|
          r.body = body
        end.to_hash[response_key]
      end

      private

      def body
        {:country_code => @vat.vat_country_code, :vat_number => @vat.to_s_wo_country}
      end

      def action
        :check_vat
      end

      def response_key
        :check_vat_response
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
valvat-0.4.7 lib/valvat/lookup/request.rb
valvat-0.4.6 lib/valvat/lookup/request.rb
valvat-0.4.5 lib/valvat/lookup/request.rb
valvat-0.4.4 lib/valvat/lookup/request.rb
valvat-0.4.3 lib/valvat/lookup/request.rb
valvat-0.4.2 lib/valvat/lookup/request.rb