Class: Edmunds::Vehicle::Specification::Style::StylesCount
- Inherits:
-
Object
- Object
- Edmunds::Vehicle::Specification::Style::StylesCount
- 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) ⇒ StylesCount
constructor
A new instance of StylesCount.
Constructor Details
#initialize(attributes) ⇒ StylesCount
174 175 176 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 174 def initialize(attributes) @count = attributes['stylesCount'] end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
172 173 174 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 172 def count @count end |
Class Method Details
.find(api_params = {}) ⇒ Object
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/edmunds/vehicle/specification/style.rb', line 178 def self.find(api_params = {}) response = Edmunds::Api.get("#{STYLE_API_URL}/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 |