Class: ProjectSimulator::TimeConstraint
- Inherits:
-
Object
- Object
- ProjectSimulator::TimeConstraint
- Defined in:
- lib/projectsimulator.rb
Instance Attribute Summary collapse
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(timesx, times: timesx, time: nil) ⇒ TimeConstraint
constructor
A new instance of TimeConstraint.
- #match ⇒ Object
- #to_node ⇒ Object
- #to_rowx ⇒ Object
Constructor Details
#initialize(timesx, times: timesx, time: nil) ⇒ TimeConstraint
Returns a new instance of TimeConstraint.
436 437 438 |
# File 'lib/projectsimulator.rb', line 436 def initialize(timesx, times: timesx, time: nil) @times, @time = times, time end |
Instance Attribute Details
#time ⇒ Object
Returns the value of attribute time.
434 435 436 |
# File 'lib/projectsimulator.rb', line 434 def time @time end |
Instance Method Details
#match ⇒ Object
440 441 442 |
# File 'lib/projectsimulator.rb', line 440 def match() ChronicBetween.new(@times).within?(@time) end |
#to_node ⇒ Object
444 445 446 447 |
# File 'lib/projectsimulator.rb', line 444 def to_node() Rexle::Element.new(:constraint, \ attributes: {type: :time, times: @times}) end |
#to_rowx ⇒ Object
449 450 451 |
# File 'lib/projectsimulator.rb', line 449 def to_rowx() "constraint: %s" % @times end |