# Europe This gem provides EU governmental data, extracted from various EU / EC websites. With this gem you can validate VAT numbers, retrieve VAT tax rates and currency exchange rates matched to the Euro. How to use this gem is pretty straightforward and written below. ## Installation Add this line to your application's Gemfile: ```ruby gem 'europe' ``` And then execute: $ bundle Or install it yourself as: $ gem install europe ## Usage There are several calls you can make with this gem. Below are a few examples where this gem can be used for. ### Validating VAT numbers Call ```ruby Europe::Vat.validate('GB', '440627467') ``` Response ```ruby { :country_code=>"GB", :vat_number=>"440627467", :request_date=>#, :valid=>true, :name=>"SKY PLC", :address=>"6 CENTAURS BUSINESS PARK\nGRANT WAY\nISLEWORTH\nMIDDLESEX\n\nTW7 5QD" } ``` ### Retrieving VAT rates for each EC/EU member Call ```ruby Europe::Vat::Rates.retrieve ``` Response ```ruby { :AT=>20.0, :BE=>21.0, :BG=>20.0, :CY=>19.0, :CZ=>21.0, :DE=>19.0, :DK=>25.0, # etc... ``` ### Retrieving currency exchange rates Call ```ruby Europe::Currency::ExchangeRates.retrieve ``` Response ```ruby { :date=>#, :rates=> { :USD=>1.099, :JPY=>132.97, :BGN=>1.9558, :CZK=>27.022, :DKK=>7.4614, :GBP=>0.7252, # etc... ``` ### Retrieving currency information Call ```ruby Europe::Currency::CURRENCIES ``` Response ```ruby CURRENCIES = { EUR: { name: 'Euro', symbol: '€', html: '€' }, BGN: { name: 'Lev', symbol: 'лв', html: 'лв' }, ``` ## Retrieving country information Call ```ruby Europe::Countries::COUNTRIES ``` Response ```ruby { :BE=>{ :name=>"Belgium", :source_name=>"Belgique/België", :official_name=>"Kingdom of Belgium" }, :BG=>{ :name=>"Bulgaria", :source_name=>"България", :official_name=>"Republic of Bulgaria" }, ``` ## Retrieving country information reversed Call ```ruby Europe::Countries.name_to_code ``` Response ```ruby { "Belgium" => :BE, "Bulgaria" => :BG, "Czech Republic" => :CZ, "Denmark" => :DK, "Germany" => :DE, "Estonia" => :EE, ``` ## Contributing 1. Fork it ( https://github.com/VvanGemert/europe/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request