You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
316 B
Ruby
20 lines
316 B
Ruby
class SnapshotPresenter < Draper::Decorator
|
|
|
|
delegate :map
|
|
|
|
def to_html
|
|
h.content_tag(:pre, lines_html.html_safe, :class => 'terminal')
|
|
end
|
|
|
|
private
|
|
|
|
def lines_html
|
|
map { |line| line_html(line) }.join("\n") + "\n"
|
|
end
|
|
|
|
def line_html(line)
|
|
SnapshotLinePresenter.new(line).to_html
|
|
end
|
|
|
|
end
|