class VatCheck
Constants
- VERSION
Attributes
regex[R]
response[R]
vies[R]
vies_available[R]
Public Class Methods
new(vat)
click to toggle source
# File lib/vat_check.rb, line 9 def initialize(vat) @vat = vat @regex = VatCheck::Format.valid?(@vat) @response = @regex ? VatCheck::Request.lookup(@vat) : {} @vies_available = @response.has_key?(:valid) @vies = @vies_available ? @response[:valid] : false end
Public Instance Methods
exists?()
click to toggle source
# File lib/vat_check.rb, line 23 def exists? return @vies end
valid?()
click to toggle source
# File lib/vat_check.rb, line 17 def valid? return false unless @regex return @regex unless @vies_available return @vies end