Class: TaskLoop::EndPointBoundaryRule
- Inherits:
-
BoundaryRule
- Object
- Rule
- BoundaryRule
- TaskLoop::EndPointBoundaryRule
- Defined in:
- lib/taskloop/rules/end_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) ⇒ EndPointBoundaryRule
constructor
A new instance of EndPointBoundaryRule.
- #is_conform_rule?(last_exec_time) ⇒ Boolean
Constructor Details
#initialize(unit, value) ⇒ EndPointBoundaryRule
Returns a new instance of EndPointBoundaryRule.
4 5 6 7 |
# File 'lib/taskloop/rules/end_point_boundary_rule.rb', line 4 def initialize(unit, value) super unit, :end @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/taskloop/rules/end_point_boundary_rule.rb', line 3 def value @value end |
Instance Method Details
#desc ⇒ Object
17 18 19 |
# File 'lib/taskloop/rules/end_point_boundary_rule.rb', line 17 def desc super + " to #{value}" end |
#is_conform_rule?(last_exec_time) ⇒ Boolean
9 10 11 12 13 14 15 |
# File 'lib/taskloop/rules/end_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) end_time = date_object.to_i return current <= end_time end |