Class: VinDecoder::Client
- Inherits:
-
Object
- Object
- VinDecoder::Client
- Defined in:
- lib/vin_decoder/client.rb
Instance Method Summary collapse
- #decode(vin) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 |
# File 'lib/vin_decoder/client.rb', line 5 def initialize config = VinDecoder.configuration || Configuration.new @connection = Faraday.new(url: config.base_url) do |faraday| faraday..timeout = config.timeout faraday.adapter Faraday.default_adapter end end |
Instance Method Details
#decode(vin) ⇒ Object
13 14 15 16 17 |
# File 'lib/vin_decoder/client.rb', line 13 def decode(vin) response = @connection.get("DecodeVinValuesExtended/#{vin}", format: 'json') handle_response(response) end |