Class: Kms::ProductDrop

Inherits:
Liquor::Drop
  • Object
show all
Defined in:
lib/drops/kms/product_drop.rb

Instance Method Summary collapse

Instance Method Details

#image_urlObject



15
16
17
# File 'lib/drops/kms/product_drop.rb', line 15

def image_url
  source.master.image.url
end

#priceObject



19
20
21
# File 'lib/drops/kms/product_drop.rb', line 19

def price
  source.master.price.to_s
end

#propertiesObject



23
24
25
26
27
28
29
# File 'lib/drops/kms/product_drop.rb', line 23

def properties
  props = []
  source.properties.group_by(&:tag).each do |key, value|
    props << [key, value.map { |val| [val.name, val.value] }]
  end
  props
end