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.
30 lines
479 B
Ruby
30 lines
479 B
Ruby
11 years ago
|
class HomePagePresenter
|
||
11 years ago
|
|
||
11 years ago
|
attr_reader :playback_options
|
||
|
|
||
|
def initialize
|
||
|
@playback_options = PlaybackOptions.new(speed: 2.0, hide_hud: true)
|
||
|
end
|
||
|
|
||
11 years ago
|
def asciicast
|
||
|
@asciicast ||= get_asciicast
|
||
|
end
|
||
|
|
||
|
def latest_asciicasts
|
||
11 years ago
|
Asciicast.latest_limited(3).decorate
|
||
11 years ago
|
end
|
||
|
|
||
|
def featured_asciicasts
|
||
11 years ago
|
Asciicast.random_featured_limited(3).decorate
|
||
11 years ago
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def get_asciicast
|
||
|
asciicast = CFG.home_asciicast
|
||
|
|
||
11 years ago
|
asciicast && asciicast.decorate
|
||
11 years ago
|
end
|
||
|
|
||
|
end
|