class MotoRecall::Client::Subaru

Public Class Methods

url(vin) click to toggle source
# File lib/moto_recall/client/subaru.rb, line 5
def self.url(vin)
  "http://www.subaru.com/services/vehicles/recalls/?vin=#{vin}"
end

Public Instance Methods

format(recall) click to toggle source
# File lib/moto_recall/client/subaru.rb, line 14
def format(recall)
  {
    type: recall["type"],
    nhtsa_number: recall["nhtsaRecallNumber"],
    oem_number: recall["code"],
    date: recall["fullDate"],
    title: recall["shortDescription"],
    description: recall["description"],
    safety_risk: recall["safefyRiskDescription"],
    remedy: recall["remedyDescription"],
    status: recall["status"],
    notes: nil
  }
end
process(data) click to toggle source
# File lib/moto_recall/client/subaru.rb, line 9
def process(data)
  parsed_data = JSON.parse(data)
  parsed_data["recalls"]
end