Sha256: 34e78be42618cecdc803d149df54e5b8dfa8cd13f21e207656661e12a0b1f6c7

Contents?: true

Size: 539 Bytes

Versions: 15

Compression:

Stored size: 539 Bytes

Contents

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

      def perform(client)
        client.call(action, :message => body, :message_tag => message_tag).to_hash[response_key]
      end

      private

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

      def message_tag
        :checkVat
      end

      def action
        :check_vat
      end

      def response_key
        :check_vat_response
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
valvat-0.9.1 lib/valvat/lookup/request.rb
valvat-0.9.0 lib/valvat/lookup/request.rb
valvat-0.8.2 lib/valvat/lookup/request.rb
valvat-0.8.1 lib/valvat/lookup/request.rb
valvat-0.8.0 lib/valvat/lookup/request.rb
valvat-0.7.4 lib/valvat/lookup/request.rb
valvat-0.7.3 lib/valvat/lookup/request.rb
valvat-0.7.2 lib/valvat/lookup/request.rb
valvat-0.7.1 lib/valvat/lookup/request.rb
valvat-0.7.0 lib/valvat/lookup/request.rb
valvat-0.6.11 lib/valvat/lookup/request.rb
valvat-0.6.10 lib/valvat/lookup/request.rb
valvat-0.6.9 lib/valvat/lookup/request.rb
valvat-0.6.8 lib/valvat/lookup/request.rb
valvat-0.6.7 lib/valvat/lookup/request.rb