2014-02-01 00:26:58 +00:00
|
|
|
class HomePagePresenter
|
2014-01-17 13:52:37 +00:00
|
|
|
|
2014-01-18 13:12:10 +00:00
|
|
|
attr_reader :playback_options
|
|
|
|
|
|
|
|
def initialize
|
2014-06-30 17:30:18 +00:00
|
|
|
@playback_options = PlaybackOptions.new(speed: 2.0)
|
2014-01-18 13:12:10 +00:00
|
|
|
end
|
|
|
|
|
2014-01-17 13:52:37 +00:00
|
|
|
def asciicast
|
|
|
|
@asciicast ||= get_asciicast
|
|
|
|
end
|
|
|
|
|
|
|
|
def latest_asciicasts
|
2014-07-05 17:37:21 +00:00
|
|
|
Asciicast.latest_limited(6).decorate
|
2014-01-17 13:52:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def featured_asciicasts
|
2014-07-05 17:37:21 +00:00
|
|
|
Asciicast.random_featured_limited(6).decorate
|
2014-01-17 13:52:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def get_asciicast
|
|
|
|
asciicast = CFG.home_asciicast
|
|
|
|
|
2014-01-18 11:21:33 +00:00
|
|
|
asciicast && asciicast.decorate
|
2014-01-17 13:52:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|