Class: Ruby::Vies::Client

Inherits:
Object
  • Object
show all
Includes:
Finest::Builder, HTTParty, Savon
Defined in:
lib/ruby/vies.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = nil) ⇒ Client

Returns a new instance of Client.



36
37
38
# File 'lib/ruby/vies.rb', line 36

def initialize(args = nil)
  super args || {}
end

Instance Method Details

#check_vat_details(args) ⇒ Object



40
41
42
43
44
# File 'lib/ruby/vies.rb', line 40

def check_vat_details(args)
  (args[:country_code].upcase == "FR" ? check_siren(args) : check_vat(args)).with_indifferent_access
rescue StandardError => e
  { error: e&.message, valid: false }
end