Class: Edmunds::Vehicle::Specification::Color::ColorsDetails
- Inherits:
-
Object
- Object
- Edmunds::Vehicle::Specification::Color::ColorsDetails
- Defined in:
- lib/edmunds/vehicle/specification/color.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#color_chips ⇒ Object
readonly
Returns the value of attribute color_chips.
-
#equipment_type ⇒ Object
readonly
Returns the value of attribute equipment_type.
-
#fabric_Types ⇒ Object
readonly
Returns the value of attribute fabric_Types.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#manufacture_option_code ⇒ Object
readonly
Returns the value of attribute manufacture_option_code.
-
#manufacture_option_name ⇒ Object
readonly
Returns the value of attribute manufacture_option_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ColorsDetails
constructor
A new instance of ColorsDetails.
Constructor Details
#initialize(attributes) ⇒ ColorsDetails
Returns a new instance of ColorsDetails.
51 52 53 54 55 56 57 58 59 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 51 def initialize(attributes) @id = attributes['id'] @name = attributes['name'] @equipment_type = attributes['equipmentType'] @availability = attributes['availability'] @manufacture_option_name = attributes['manufactureOptionName'] @manufacture_option_code = attributes['manufactureOptionCode'] @category = attributes['category'] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def attributes @attributes end |
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def availability @availability end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def category @category end |
#color_chips ⇒ Object (readonly)
Returns the value of attribute color_chips.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def color_chips @color_chips end |
#equipment_type ⇒ Object (readonly)
Returns the value of attribute equipment_type.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def equipment_type @equipment_type end |
#fabric_Types ⇒ Object (readonly)
Returns the value of attribute fabric_Types.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def fabric_Types @fabric_Types end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def id @id end |
#manufacture_option_code ⇒ Object (readonly)
Returns the value of attribute manufacture_option_code.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def manufacture_option_code @manufacture_option_code end |
#manufacture_option_name ⇒ Object (readonly)
Returns the value of attribute manufacture_option_name.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def manufacture_option_name @manufacture_option_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40 41 42 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 40 def name @name end |
Class Method Details
.find(color_id, api_params = {}) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/edmunds/vehicle/specification/color.rb', line 61 def self.find(color_id, api_params = {}) response = Edmunds::Api.get("#{COLORS_API_URL}/#{color_id}") do |request| request.raw_parameters = api_params request.allowed_parameters = { fmt: %w[json] } request.default_parameters = { fmt: 'json' } request.required_parameters = %w[fmt] end attributes = JSON.parse(response.body) new(attributes) end |