class Edmunds::Vehicle::Specification::Style::Style
Attributes
body[R]
id[R]
make_name[R]
model_name[R]
name[R]
trim[R]
year[R]
Public Class Methods
find(id, api_params = {})
click to toggle source
# File lib/edmunds/vehicle/specification/style.rb, line 25 def self.find(id, api_params = {}) response = Edmunds::Api.get("#{STYLE_API_URL}/#{id}") do |request| request.raw_parameters = api_params request.allowed_parameters = { view: %w[basic full], fmt: %w[json] } request.default_parameters = { view: 'basic', fmt: 'json' } request.required_parameters = %w[fmt] end attributes = JSON.parse(response.body) new(attributes) end
new(attributes)
click to toggle source
# File lib/edmunds/vehicle/specification/style.rb, line 14 def initialize(attributes) @id = attributes['id'] @name = attributes['name'] @trim = attributes['trim'] @body = attributes['submodel']['body'] # TODO: Not sure whether this is valuable or not to expose... # @year = attributes["year"]["year"] # @make_name = attributes["make"]["name"] # @model_name = attributes["model"]["name"] end