Method: Generator#ls
- Defined in:
- lib/nikki.rb
#ls ⇒ String
Display Nikki’s latest entires
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/nikki.rb', line 52 def ls YAML::Store.new(NIKKI_FILE).transaction do |store| entries = store['entries'].last(5) entries.each do |entry| entry.each do |date, text| puts "#{date}: #{text}" end end end end |