Class: Edmunds::Vehicle::Specification::Style::StylesCountMakeModelYear
- Inherits:
-
Object
- Object
- Edmunds::Vehicle::Specification::Style::StylesCountMakeModelYear
- Defined in:
- lib/edmunds/vehicle/specification/style.rb
Overview
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
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ StylesCountMakeModelYear
constructor
A new instance of StylesCountMakeModelYear.
Constructor Details
#initialize(attributes) ⇒ StylesCountMakeModelYear
Returns a new instance of StylesCountMakeModelYear.
95 96 97 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 95 def initialize(attributes) @count = attributes['stylesCount'] end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
93 94 95 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 93 def count @count end |
Class Method Details
.find(make_name, model_name, model_year, api_params = {}) ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# 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 |