Created
April 21, 2012 00:42
-
-
Save vsavkin/2432899 to your computer and use it in GitHub Desktop.
Order Presenter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OrderPresenter < Struct.new(:order) | |
def render_items | |
order.items.map do |item| | |
item_row item | |
end.join("") | |
end | |
private | |
def item_row item | |
"<div>#{item.book.title} - #{item.quantity} - #{item.amount}</div>" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment