Class: Edmunds::Vehicle::Specification::Style::StylesCountMake
- Inherits:
-
Object
- Object
- Edmunds::Vehicle::Specification::Style::StylesCountMake
- Defined in:
- lib/edmunds/vehicle/specification/style.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ StylesCountMake
constructor
A new instance of StylesCountMake.
Constructor Details
#initialize(attributes) ⇒ StylesCountMake
Returns a new instance of StylesCountMake.
148 149 150 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 148 def initialize(attributes) @count = attributes['stylesCount'] end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
146 147 148 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 146 def count @count end |
Class Method Details
.find(make_name, api_params = {}) ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 152 def self.find(make_name, api_params = {}) response = Edmunds::Api.get("#{BASE_API_URL}/#{make_name}/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 |