Class: SirvRestApi::ProductMeta

Inherits:
Object
  • Object
show all
Defined in:
lib/sirv_rest_api/models.rb

Overview

Product metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#brandObject

Returns the value of attribute brand.



181
182
183
# File 'lib/sirv_rest_api/models.rb', line 181

def brand
  @brand
end

#categoryObject

Returns the value of attribute category.



181
182
183
# File 'lib/sirv_rest_api/models.rb', line 181

def category
  @category
end

#idObject

Returns the value of attribute id.



181
182
183
# File 'lib/sirv_rest_api/models.rb', line 181

def id
  @id
end

#nameObject

Returns the value of attribute name.



181
182
183
# File 'lib/sirv_rest_api/models.rb', line 181

def name
  @name
end

#skuObject

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_hObject



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