Class: Cheat::Controllers::APIRecent

Inherits:
R
  • Object
show all
Defined in:
lib/cheat/site.rb

Instance Method Summary collapse

Instance Method Details

#getObject



81
82
83
84
85
86
# File 'lib/cheat/site.rb', line 81

def get
  @headers['Content-Type'] = 'text/plain'

  sheets = Sheet.sort_by { |s| -s.created_at }.first(15).map(&:title)
  return { 'Recent Cheat Sheets' => sheets }.to_yaml
end