lib/insulin/day.rb in insulin-0.1.2 vs lib/insulin/day.rb in insulin-0.1.3

- old
+ new

@@ -1,10 +1,10 @@ require 'insulin' module Insulin class Day < Hash - attr_reader :glucose_units + attr_reader :glucose_units, :date, :day def initialize date, mongo @date = date @mongo = mongo @@ -25,10 +25,11 @@ self[sub] = [ev] end end self["all"] << ev + @day = self["all"][0]["day"] end end def has_events? if self["all"].size > 0 @@ -78,11 +79,12 @@ s = "" s << @date s << "\n" self["all"].each do |e| - if ["breakfast", "lunch", "dinner", "bedtime"].include? e["tag"] and - ["medication", "glucose"].include? e["type"] +# if ["breakfast", "lunch", "dinner", "bedtime"].include? e["tag"] and +# ["medication", "glucose"].include? e["type"] + if e.simple? s << " " s << e.simple s << "\n" end end