2013-07-25 16:02:58 +00:00
|
|
|
class SnapshotPresenter < Draper::Decorator
|
|
|
|
|
2013-08-04 21:12:18 +00:00
|
|
|
delegate :map
|
2013-07-25 16:02:58 +00:00
|
|
|
|
|
|
|
def to_html
|
2013-08-04 21:12:18 +00:00
|
|
|
h.content_tag(:pre, lines_html.html_safe, :class => 'terminal')
|
2013-07-25 16:02:58 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2013-08-04 21:12:18 +00:00
|
|
|
def lines_html
|
|
|
|
map { |line| line_html(line) }.join("\n") + "\n"
|
2013-07-25 16:02:58 +00:00
|
|
|
end
|
|
|
|
|
2013-08-04 21:12:18 +00:00
|
|
|
def line_html(line)
|
2013-07-25 16:02:58 +00:00
|
|
|
SnapshotLinePresenter.new(line).to_html
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|