asciinema.org/app/presenters/home_presenter.rb

30 lines
475 B
Ruby
Raw Normal View History

2014-01-17 13:52:37 +00:00
class HomePresenter
attr_reader :playback_options
def initialize
@playback_options = PlaybackOptions.new(speed: 2.0, hide_hud: true)
end
2014-01-17 13:52:37 +00:00
def asciicast
@asciicast ||= get_asciicast
end
def latest_asciicasts
Asciicast.latest_limited(3).decorate
2014-01-17 13:52:37 +00:00
end
def featured_asciicasts
Asciicast.random_featured_limited(3).decorate
2014-01-17 13:52:37 +00:00
end
private
def get_asciicast
asciicast = CFG.home_asciicast
asciicast && asciicast.decorate
2014-01-17 13:52:37 +00:00
end
end