🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

vat_id

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vat_id

bundlerRubyGems.org
Version
0.0.3
Version published
Maintainers
1
Created
Source

VAT Identification Number

VAT ID validation. Ships with an ActiveModel validator.

Gem Version Build Status

Installation

Add this line to your application's Gemfile:

gem 'vat_id'

And then execute:

$ bundle

Or install it yourself as:

$ gem install vat_id

Usage

v = VatId.new('DE123456789')
v.valid?       # true
v.country_code # 'DE'
v.identifier   # '123456789'
v.to_s         # 'DE123456789'

VatId.valid?('DE123456789') # true

or as ActiveModel Validator (make sure you have 'active_model' before 'vat_id' in your Gemfile)

class Company
  include ActiveModel::Model
  attr_accessor :tax_number, :name
  validates :tax_number, vat_id: true
end

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 19 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts