Skip to content

Instantly share code, notes, and snippets.

@jeffdeville
Created July 19, 2010 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffdeville/482032 to your computer and use it in GitHub Desktop.
Save jeffdeville/482032 to your computer and use it in GitHub Desktop.
class IdeaRatingIndexDto
attr_accessor :title, :url, :id
attr_writer :image
def image
@image || "/images/no_product_image.jpg"
end
def initialize(gift_idea)
@title = gift_idea.title
@url = gift_idea.url
@id = gift_idea._id.to_s
@image = (gift_idea.images[0] || Image.new).url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment