asciinema.org/app/presenters/bare_asciicast_page_presenter.rb

25 lines
530 B
Ruby
Raw Normal View History

class BareAsciicastPagePresenter
attr_reader :asciicast, :playback_options
2015-03-30 10:23:58 +00:00
def self.build(asciicast, playback_options = {})
decorated_asciicast = asciicast.decorate
playback_options = {
'theme' => decorated_asciicast.theme_name
}.merge(playback_options)
new(decorated_asciicast, PlaybackOptions.new(playback_options))
end
def initialize(asciicast, playback_options)
@asciicast = asciicast
@playback_options = playback_options
end
def asciicast_id
asciicast.to_param
end
end