Class: EverExp::Notes
- Inherits:
-
Array
- Object
- Array
- EverExp::Notes
- Defined in:
- lib/ever_exp/notes.rb
Instance Method Summary collapse
- #group_by_tag ⇒ Object
-
#initialize(dir) ⇒ Notes
constructor
A new instance of Notes.
Constructor Details
#initialize(dir) ⇒ Notes
Returns a new instance of Notes.
8 9 10 11 12 |
# File 'lib/ever_exp/notes.rb', line 8 def initialize dir group_into_notes files_in dir super notes_hash.values remove_instance_variable :@notes_hash end |
Instance Method Details
#group_by_tag ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/ever_exp/notes.rb', line 14 def group_by_tag tag_groups = Hash.new { |hash, tag| hash[tag] = [] } each do |note| note.tag_array.each do |tag| tag_groups[tag] << note end end tag_groups end |