vatlayer 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 706b59303fc12202bcda2f739f6b6d2d99b4ba37
4
- data.tar.gz: c154d5273104e9d15d25d5772c16c45ba1b83a57
3
+ metadata.gz: a8104d7fa89bec8b5084e9b5e437cc140ea8260d
4
+ data.tar.gz: e40a4ddc0baf1803fbd397c4248150b9e5c9eca9
5
5
  SHA512:
6
- metadata.gz: f6ed02ac4568f2ac5d474f7b73e4dced4d2b06b3ed7fa9b6df6e8f459553b58f802fca150fb578ec1d17daa6fa53dd1def5f68591cf6ab7c8b2c02be806ee05e
7
- data.tar.gz: 0fcd5f4e00d34a28bca1024bc5ade974b7be7811ba57656f6b3b243e74f045ad84e96c3f25af580e1c6c55dc6117f9fd2250488a451537e82f7fb6871a67cb3e
6
+ metadata.gz: 9ad135fb768bcaf0afb2242fcf8d50f18d815f572d6dcaac9509f4aec274035ffe6ed82fdcb9401103e104bcdaf87dbec53bd04db870c1e8c8403ad5e2b11c84
7
+ data.tar.gz: 6d48b90e8224dec504a9864d1f3b306bfa300130a6df589db00a020e7d65f399708c428369133dbd7c2d44f9f680bd90e4bb3cfcb07b25c9ef1f3d5740d563cb
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.1
2
+ TargetRubyVersion: 2.2
3
3
  Exclude:
4
4
  - spec/**/*
5
5
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/drEnilight/vatlayer-ruby.svg?branch=master)](https://travis-ci.org/drEnilight/vatlayer-ruby) [![codecov.io](https://codecov.io/github/drEnilight/vatlayer-ruby/coverage.svg?branch=master)](https://codecov.io/gh/drEnilight/vatlayer-ruby?branch=master)
4
4
 
5
- The Ruby gem for accessing the Vatlayer API painlessly, easily, and awesomely! This gem is actively being developed. **Be sure to check the branch for the version you're using.**
5
+ The Ruby gem for accessing the Vatlayer API painlessly, easily and awesomely! **Be sure to check the branch for the version you're using.**
6
6
 
7
7
  **Important and helpful links:**
8
8
 
@@ -76,7 +76,26 @@ vatlayer.validate(vat_number: 'LU26375245')
76
76
  ```
77
77
 
78
78
  #### Rate
79
- TODO
79
+ ```ruby
80
+ vatlayer.rate(country_code: 'gb')
81
+
82
+ # <Vatlayer::Response::Data:0x000055c949f35210
83
+ # @success=true,
84
+ # @country_code="GB",
85
+ # @country_name="United Kingdom",
86
+ # @standard_rate=20,
87
+ # @reduced_rates=#<Vatlayer::Response::Data:0x000055c949f344f0
88
+ # @property_renovations=5,
89
+ # @foodstuffs=0,
90
+ # @books=0,
91
+ # @pharmaceuticals=0,
92
+ # @medical=0,
93
+ # @passenger_transport=0,
94
+ # @newspapers=0,
95
+ # @childrens_clothing=0>>
96
+ ```
97
+
98
+ Also rate method takes parameters like `ip_address`, `use_client_ip`.
80
99
 
81
100
  #### Rate list
82
101
  ```ruby
@@ -100,7 +119,22 @@ vatlayer.rate_list
100
119
  ```
101
120
 
102
121
  #### Price
103
- TODO
122
+ ```ruby
123
+ vatlayer.price(amount: 100, country_code: 'GB', options: { type: 'medical' })
124
+
125
+ # <Vatlayer::Response::Data:0x00005564aa23e880
126
+ # @success=true,
127
+ # @country_code="GB",
128
+ # @country_name="United Kingdom",
129
+ # @price_excl_vat=100,
130
+ # @price_incl_vat=100,
131
+ # @type="medical",
132
+ # @vat_rate=0>
133
+
134
+ ```
135
+
136
+ Also price method takes parameters like `ip_address`, `use_client_ip` and optional parameters `type`, `incl`.
137
+
104
138
 
105
139
  ### Fetch errors
106
140
 
@@ -11,11 +11,20 @@ module Vatlayer
11
11
  @https = https
12
12
  end
13
13
 
14
+ def price(amount: nil, country_code: nil, ip_address: nil, use_client_ip: nil, options: {})
15
+ request('/price', amount: amount, country_code: country_code, ip_address: ip_address,
16
+ use_client_ip: use_client_ip, type: options[:type], incl: options[:incl])
17
+ end
18
+
19
+ def rate(country_code: nil, ip_address: nil, use_client_ip: nil)
20
+ request('/rate', country_code: country_code, ip_address: ip_address, use_client_ip: use_client_ip)
21
+ end
22
+
14
23
  def rate_list
15
24
  request('/rate_list')
16
25
  end
17
26
 
18
- def validate(vat_number:)
27
+ def validate(vat_number: nil)
19
28
  request('/validate', vat_number: vat_number)
20
29
  end
21
30
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vatlayer
4
- VERSION = '0.3.1'.freeze
4
+ VERSION = '0.3.2'.freeze
5
5
  end
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'rake', '~> 10.0'
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'rubocop', '~> 0.54'
29
- spec.required_ruby_version = '>= 2.1'
29
+ spec.required_ruby_version = '>= 2.2'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vatlayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Romaniuk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2018-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- version: '2.1'
132
+ version: '2.2'
133
133
  required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - ">="