asciinema.org/app/presenters/home_page_presenter.rb

34 lines
531 B
Ruby
Raw Normal View History

class HomePagePresenter
2014-01-17 13:52:37 +00:00
attr_reader :playback_options
def initialize
@playback_options = PlaybackOptions.new(speed: 2.0)
end
2014-01-17 13:52:37 +00:00
def asciicast
@asciicast ||= get_asciicast
end
def latest_asciicasts
Asciicast.latest_limited(6).decorate
2014-01-17 13:52:37 +00:00
end
def featured_asciicasts
Asciicast.random_featured_limited(6).decorate
2014-01-17 13:52:37 +00:00
end
2014-12-16 20:20:47 +00:00
def install_script_url
"https://asciinema.org/install"
end
2014-01-17 13:52:37 +00:00
private
def get_asciicast
asciicast = CFG.home_asciicast
asciicast && asciicast.decorate
2014-01-17 13:52:37 +00:00
end
end