Class: Vatlayer::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/vatlayer/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_key, https) ⇒ Api

Returns a new instance of Api.



9
10
11
12
# File 'lib/vatlayer/api.rb', line 9

def initialize(access_key, https)
  @access_key = access_key
  @https = https
end

Instance Attribute Details

#access_keyObject (readonly)

Returns the value of attribute access_key.



7
8
9
# File 'lib/vatlayer/api.rb', line 7

def access_key
  @access_key
end

#httpsObject (readonly)

Returns the value of attribute https.



7
8
9
# File 'lib/vatlayer/api.rb', line 7

def https
  @https
end

Instance Method Details

#validate(number) ⇒ Object



14
15
16
17
# File 'lib/vatlayer/api.rb', line 14

def validate(number)
  params = { vat_number: number }
  Vatlayer::Response::Data.new(request('/validate', params))
end