Class: ProductImage

Inherits:
Base
  • Object
show all
Defined in:
app/models/product_image.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL

Instance Method Summary collapse

Instance Method Details

#imageObject



6
7
8
9
10
11
# File 'app/models/product_image.rb', line 6

def image
  dragonfly = Dragonfly[:images]
  dragonfly.url_host = 'http://cdn.storesapp.com'
  dragonfly.url_path_prefix = '/images'
  dragonfly.fetch(self.image_uid)
end

#productObject



2
3
4
# File 'app/models/product_image.rb', line 2

def product
  Product.find(:first, :from => "/v1/products/#{self.product_id}.xml")
end