Class: TaskLoop::IntervalRule

Inherits:
Rule
  • Object
show all
Defined in:
lib/taskloop/rules/interval_rule.rb

Constant Summary

Constants inherited from Rule

Rule::UNIT

Instance Attribute Summary collapse

Attributes inherited from Rule

#unit

Instance Method Summary collapse

Constructor Details

#initialize(unit, interval) ⇒ IntervalRule

Returns a new instance of IntervalRule.



6
7
8
9
# File 'lib/taskloop/rules/interval_rule.rb', line 6

def initialize(unit, interval)
  super unit
  @interval = interval
end

Instance Attribute Details

#intervalObject

Returns the value of attribute interval.



4
5
6
# File 'lib/taskloop/rules/interval_rule.rb', line 4

def interval
  @interval
end

Instance Method Details

#descObject



17
18
19
# File 'lib/taskloop/rules/interval_rule.rb', line 17

def desc
  super + "; interval: #{interval}"
end

#is_conform_rule?(last_exec_time) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/taskloop/rules/interval_rule.rb', line 11

def is_conform_rule?(last_exec_time)
  # interval rule is different for other rules. It should be calculated by combining the interval times of all units.
  # So here returns false
  return false
end