lib/when_exe/calendarnote.rb in when_exe-0.4.0 vs lib/when_exe/calendarnote.rb in when_exe-0.4.1

- old
+ new

@@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- =begin - Copyright (C) 2011-2014 Takashi SUGA + Copyright (C) 2011-2015 Takashi SUGA You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive. =end module When @@ -205,10 +205,13 @@ # # 暦法によってイベントの動作を変えるか否か # CalendarDepend = false + # @private + HashProperty = [:event] + # デフォルトイベント名 # # @return [String] # # @note イベント名の後ろに数字が使われている場合、数字部分以降はイベントメソッドの引数になります。 @@ -433,17 +436,18 @@ notes.delete(note) unless focused_notes_actual.include?(note) end # return Array of Hash focused_notes.map {|note| + nobj = note_objects[note] case notes[note] when nil, false ; {} - when Hash ; {:note=>note_objects[note].label}.merge(notes[note]) + when Hash ; {:note=>nobj.label}.merge(notes[note]) else - if note_objects[note].respond_to?(:to_note_hash) - note_objects[note].to_note_hash(notes[note], dates) + if nobj.respond_to?(:to_note_hash) + nobj.to_note_hash(notes[note], dates) else - {:note=>note_objects[note].label, :value=>notes[note]} + {:note=>nobj.kind_of?(String) ? nobj : nobj.label, :value=>notes[note]} end end } end