Class: RRDNotifier::AlarmMissingData

Inherits:
Alarm
  • Object
show all
Defined in:
lib/rrd-grapher/notifier/alarms.rb

Instance Attribute Summary collapse

Attributes inherited from Alarm

#packet

Instance Method Summary collapse

Methods inherited from Alarm

#method_missing

Constructor Details

#initialize(p, allowed_interval, last_update) ⇒ AlarmMissingData

Returns a new instance of AlarmMissingData.



51
52
53
54
55
# File 'lib/rrd-grapher/notifier/alarms.rb', line 51

def initialize(p, allowed_interval ,last_update)
  super(p)
  @allowed_interval = allowed_interval
  @last_update = last_update
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RRDNotifier::Alarm

Instance Attribute Details

#allowed_intervalObject

Time allowed between updates.



45
46
47
# File 'lib/rrd-grapher/notifier/alarms.rb', line 45

def allowed_interval
  @allowed_interval
end

#last_updateObject

When was this measure last updated ?



49
50
51
# File 'lib/rrd-grapher/notifier/alarms.rb', line 49

def last_update
  @last_update
end

Instance Method Details

#is_same?(allowed_interval, last_update) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
60
# File 'lib/rrd-grapher/notifier/alarms.rb', line 57

def is_same?(allowed_interval ,last_update)
  (@allowed_interval == allowed_interval) &&
  (@last_update == last_update)
end

#reasonObject



41
# File 'lib/rrd-grapher/notifier/alarms.rb', line 41

def reason; :missing_data; end