Class: SirvRestApi::ProductMeta
- Inherits:
-
Object
- Object
- SirvRestApi::ProductMeta
- Defined in:
- lib/sirv_rest_api/models.rb
Overview
Product metadata
Instance Attribute Summary collapse
-
#brand ⇒ Object
Returns the value of attribute brand.
-
#category ⇒ Object
Returns the value of attribute category.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sku ⇒ Object
Returns the value of attribute sku.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ ProductMeta
constructor
A new instance of ProductMeta.
- #to_h ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ ProductMeta
Returns a new instance of ProductMeta.
183 184 185 186 187 188 189 |
# File 'lib/sirv_rest_api/models.rb', line 183 def initialize(data = {}) @id = data["id"] @name = data["name"] @brand = data["brand"] @category = data["category"] @sku = data["sku"] end |
Instance Attribute Details
#brand ⇒ Object
Returns the value of attribute brand.
181 182 183 |
# File 'lib/sirv_rest_api/models.rb', line 181 def brand @brand end |
#category ⇒ Object
Returns the value of attribute category.
181 182 183 |
# File 'lib/sirv_rest_api/models.rb', line 181 def category @category end |
#id ⇒ Object
Returns the value of attribute id.
181 182 183 |
# File 'lib/sirv_rest_api/models.rb', line 181 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
181 182 183 |
# File 'lib/sirv_rest_api/models.rb', line 181 def name @name end |
#sku ⇒ Object
Returns the value of attribute sku.
181 182 183 |
# File 'lib/sirv_rest_api/models.rb', line 181 def sku @sku end |
Instance Method Details
#to_h ⇒ Object
191 192 193 194 195 196 197 198 199 |
# File 'lib/sirv_rest_api/models.rb', line 191 def to_h { id: @id, name: @name, brand: @brand, category: @category, sku: @sku }.compact end |