Class: TaskLoop::Rule
- Inherits:
-
Object
- Object
- TaskLoop::Rule
- Defined in:
- lib/taskloop/rules/rule.rb
Direct Known Subclasses
BoundaryRule, DateListRule, DefaultRule, IntervalRule, LoopRule, ScopeRule, SpecificRule, TimeListRule
Constant Summary collapse
- UNIT =
{ :unknown => 0, :minute => 1, # support interval/scope/specific syntax :hour => 2, # support interval/scope/specific syntax :day => 3, # support interval/scope/specific syntax :month => 4, # support interval/scope/specific syntax :year => 5, # support interval/scope/specific syntax :week => 6, # support scope/specific syntax :loop => 7, # only support loop syntax :date => 8, # only support date list syntax :time => 9, # only support time list syntax :full => 10, # only support boundary syntax }
Instance Attribute Summary collapse
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
- #desc ⇒ Object
-
#initialize(unit = :unknown) ⇒ Rule
constructor
A new instance of Rule.
- #is_conform_rule?(last_exec_time) ⇒ Boolean
Constructor Details
#initialize(unit = :unknown) ⇒ Rule
Returns a new instance of Rule.
20 21 22 |
# File 'lib/taskloop/rules/rule.rb', line 20 def initialize(unit = :unknown) @unit = unit end |
Instance Attribute Details
#unit ⇒ Object
Returns the value of attribute unit.
18 19 20 |
# File 'lib/taskloop/rules/rule.rb', line 18 def unit @unit end |
Instance Method Details
#desc ⇒ Object
28 29 30 |
# File 'lib/taskloop/rules/rule.rb', line 28 def desc "unit: #{unit.to_s}" end |
#is_conform_rule?(last_exec_time) ⇒ Boolean
24 25 26 |
# File 'lib/taskloop/rules/rule.rb', line 24 def is_conform_rule?(last_exec_time) raise NotImplementedError, 'subclass need implement this method!' end |