class Edmunds::Vehicle::Specification::Style::StylesCountMakeModelYear

def self.find(chrome_id, api_params = {})
  response = Edmunds::Api.get("#{BASE_API_URL}/partners/chrome/styles/#{chrome_id}", api_params)
  attributes = JSON.parse(response.body)
  new(attributes)
end

end

Attributes

count[R]

Public Class Methods

find(make_name, model_name, model_year, api_params = {}) click to toggle source
# File lib/edmunds/vehicle/specification/style.rb, line 99
def self.find(make_name, model_name, model_year, api_params = {})
  response = Edmunds::Api.get("#{BASE_API_URL}/#{make_name}/#{model_name}/#{model_year}/styles/count") do |request|
    request.raw_parameters = api_params

    request.allowed_parameters = {
      state: %w[new used future],
      fmt:  %w[json]
    }

    request.default_parameters = { 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 95
def initialize(attributes)
  @count = attributes['stylesCount']
end