class TimeConstraint
Attributes
time[RW]
Public Class Methods
new(timex=nil, times: timex, time: timex)
click to toggle source
# File lib/macrohub.rb, line 158 def initialize(timex=nil, times: timex, time: timex) @time = times || time end
Public Instance Methods
match?(detail)
click to toggle source
# File lib/macrohub.rb, line 164 def match?(detail) if $debug then puts 'inside TimeConstraint#match?' puts 'detail: ' + detail.inspect puts '@time: ' + @time.inspect end ChronicBetween.new(@time).within?(detail[:time]) end
to_node()
click to toggle source
# File lib/macrohub.rb, line 176 def to_node() Rexle::Element.new(:constraint, \ attributes: {type: :time, time: @time}) end
to_rowx()
click to toggle source
# File lib/macrohub.rb, line 181 def to_rowx() "constraint: %s" % @time end