Class: TaskLoop::StartPointBoundaryRule
- Inherits:
-
BoundaryRule
- Object
- Rule
- BoundaryRule
- TaskLoop::StartPointBoundaryRule
- Defined in:
- lib/taskloop/rules/start_point_boundary_rule.rb
Constant Summary
Constants inherited from BoundaryRule
Constants inherited from Rule
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from BoundaryRule
Attributes inherited from Rule
Instance Method Summary collapse
- #desc ⇒ Object
-
#initialize(unit, value) ⇒ StartPointBoundaryRule
constructor
A new instance of StartPointBoundaryRule.
- #is_conform_rule?(last_exec_time) ⇒ Boolean
Constructor Details
#initialize(unit, value) ⇒ StartPointBoundaryRule
Returns a new instance of StartPointBoundaryRule.
4 5 6 7 |
# File 'lib/taskloop/rules/start_point_boundary_rule.rb', line 4 def initialize(unit, value) super unit, :start @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/taskloop/rules/start_point_boundary_rule.rb', line 3 def value @value end |
Instance Method Details
#desc ⇒ Object
17 18 19 |
# File 'lib/taskloop/rules/start_point_boundary_rule.rb', line 17 def desc super + " from #{value}" end |
#is_conform_rule?(last_exec_time) ⇒ Boolean
9 10 11 12 13 14 15 |
# File 'lib/taskloop/rules/start_point_boundary_rule.rb', line 9 def is_conform_rule?(last_exec_time) current = Time.now.to_i date_format = "%Y-%m-%d %H:%M:%S" date_object = Time.strptime(value, date_format) start_time = date_object.to_i return current >= start_time end |