module DailyRep::Changable

Public Instance Methods

track_change(value, delta) click to toggle source
# File lib/dailyrep/Changable.rb, line 3
def track_change value, delta
  value = value.to_f
  delta = delta.to_f
  push = 0
  if value.abs > delta then
    a_r_out = self.check_history_notif(self.entity.to_s, :delta.to_s)
    if a_r_out.nil? then
      push = 1
    else
      if (a_r_out.to_f - value).abs > delta.to_i then
        push = 1
      end
    end
  end
  return push
end