Sha256: fe2a0e2f2917c38a344a69c3366cb347b50bdb6ae5ad227e8829f8b2d000d7b6

Contents?: true

Size: 459 Bytes

Versions: 7

Compression:

Stored size: 459 Bytes

Contents

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

      def perform(client)
        client.call(action, :message => body).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

7 entries across 7 versions & 1 rubygems

Version Path
valvat-0.6.6 lib/valvat/lookup/request.rb
valvat-0.6.5 lib/valvat/lookup/request.rb
valvat-0.6.4 lib/valvat/lookup/request.rb
valvat-0.6.3 lib/valvat/lookup/request.rb
valvat-0.6.2 lib/valvat/lookup/request.rb
valvat-0.6.1 lib/valvat/lookup/request.rb
valvat-0.6.0 lib/valvat/lookup/request.rb