carsxe_api 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +3 -9
- data/carsxe_api.gemspec +1 -1
- data/lib/carsxe_api/client/client.rb +38 -19
- data/lib/carsxe_api/version.rb +2 -2
- data/lib/carsxe_api.rb +7 -2
- data/sig/carsxe_api.rbs +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c147dee79135e543eb382845344d55dac6282cedcc24385a1c02f8e22ad8526b
|
4
|
+
data.tar.gz: 708d47e4cdcb0edfe0fecb52766424e94c882c4c6102878b32cb2bc1dc83181a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 942f3c4ab50e858e8e5ee7b1f8391b9332c17256c44824f98f4a8ec5d2d21db66fbe85e544d29be351dbc595019b83c3988b7fb5fb7ab4988148699f6c5fd8d9
|
7
|
+
data.tar.gz: 342acce5db6e6440d977d7f06ed41a753de48baed49a71979b93c739b14f3b26fa3096ffb23c54517d197cb1429dd9eb9748c8b52a0107c0e6020d736afe359a
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,21 @@
|
|
1
1
|
## [Unreleased]
|
2
|
+
- History
|
3
|
+
- Images
|
4
|
+
- What Car is That
|
5
|
+
- Plate Recognition
|
6
|
+
- OBD Codes Decoder
|
7
|
+
|
8
|
+
## [0.1.3] - 2022-06-09
|
9
|
+
- Fixed bug where I put the market value function outside the class
|
10
|
+
- Added specifications API
|
11
|
+
|
12
|
+
## [0.1.2] - 2022-06-09
|
13
|
+
- Actually fixed dotenv issue
|
14
|
+
|
15
|
+
## [0.1.1] - 2022-06-09
|
16
|
+
|
17
|
+
- Fixing issue with dotenv
|
18
|
+
- Updated module name to match styling of company
|
2
19
|
|
3
20
|
## [0.1.0] - 2022-06-09
|
4
21
|
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
17
17
|
#### Declare client
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
client =
|
20
|
+
client = CarsXEApi::Client.new(ENV['CARS_XE_API_KEY'])
|
21
21
|
```
|
22
22
|
|
23
23
|
#### Plate Decoder
|
@@ -30,15 +30,9 @@ data = client.plate_decoder('HOWDY12', 'TX')
|
|
30
30
|
```ruby
|
31
31
|
data = client.market_value('ENTER_VIN_HERE')
|
32
32
|
```
|
33
|
-
## Development
|
34
|
-
|
35
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
36
|
-
|
37
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
38
|
-
|
39
33
|
## Contributing
|
40
34
|
|
41
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/jippylong12/carsxe_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/jippylong12/carsxe_api/blob/master/CODE_OF_CONDUCT.md).
|
42
36
|
|
43
37
|
## License
|
44
38
|
|
@@ -46,4 +40,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
46
40
|
|
47
41
|
## Code of Conduct
|
48
42
|
|
49
|
-
Everyone interacting in the
|
43
|
+
Everyone interacting in the CarsXEApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jippylong12/carsxe_api/blob/master/CODE_OF_CONDUCT.md).
|
data/carsxe_api.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module CarsXEApi
|
2
2
|
class Client
|
3
3
|
@@base_url = 'https://api.carsxe.com'
|
4
4
|
@@api_key = ''
|
@@ -26,25 +26,44 @@ module CarsxeApi
|
|
26
26
|
}
|
27
27
|
end
|
28
28
|
end
|
29
|
-
end
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
30
|
+
def market_value(vin, options={format: 'json'})
|
31
|
+
uri = URI("#{@@base_url}/marketvalue")
|
32
|
+
params = {key: @@api_key, vin: vin}
|
33
|
+
params.merge!(options)
|
34
|
+
uri.query = URI.encode_www_form(params)
|
35
|
+
response = @http.get_response(uri)
|
36
|
+
if response.code == "200"
|
37
|
+
{
|
38
|
+
success: true,
|
39
|
+
data: JSON.parse(response.body)
|
40
|
+
}
|
41
|
+
else
|
42
|
+
{
|
43
|
+
success: false,
|
44
|
+
data: {}
|
45
|
+
}
|
46
|
+
end
|
47
47
|
end
|
48
|
-
end
|
49
48
|
|
49
|
+
def specifications(vin, options={format: 'json'})
|
50
|
+
uri = URI("#{@@base_url}/specs")
|
51
|
+
params = {key: @@api_key, vin: vin}
|
52
|
+
params.merge!(options)
|
53
|
+
uri.query = URI.encode_www_form(params)
|
54
|
+
response = @http.get_response(uri)
|
55
|
+
if response.code == "200"
|
56
|
+
{
|
57
|
+
success: true,
|
58
|
+
data: JSON.parse(response.body)
|
59
|
+
}
|
60
|
+
else
|
61
|
+
{
|
62
|
+
success: false,
|
63
|
+
data: {}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
50
69
|
end
|
data/lib/carsxe_api/version.rb
CHANGED
data/lib/carsxe_api.rb
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'json'
|
3
|
-
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'dotenv/load'
|
6
|
+
rescue LoadError
|
7
|
+
|
8
|
+
end
|
4
9
|
|
5
10
|
require_relative "carsxe_api/version"
|
6
11
|
|
7
12
|
require_relative "carsxe_api/client"
|
8
13
|
|
9
|
-
module
|
14
|
+
module CarsXEApi
|
10
15
|
class Error < StandardError; end
|
11
16
|
|
12
17
|
end
|
data/sig/carsxe_api.rbs
CHANGED