Class: Moodswings::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/moodswings/storage.rb

Constant Summary collapse

DB_PATH =
"~/.moodswings"

Instance Method Summary collapse

Instance Method Details

#listObject



7
8
9
10
11
12
13
# File 'lib/moodswings/storage.rb', line 7

def list
  puts ""
  moods.each do |mood|
    puts mood.name
  end
  puts ""
end

#mood_pathsObject



23
24
25
# File 'lib/moodswings/storage.rb', line 23

def mood_paths
  Dir[File.expand_path(DB_PATH + "/*.mood")]
end

#moodsObject



15
16
17
18
19
20
21
# File 'lib/moodswings/storage.rb', line 15

def moods
  @moods ||= mood_paths.reject do |path|

  end.map do |path|
    Mood.new(path)
  end
end