class TimeFrame
Time Frame¶ ↑
Timeframes are the temporal bounds of the analysis window.
Attributes
active[R]
end_date[R]
start_date[R]
Public Class Methods
new(args=nil)
click to toggle source
# File models/AnalysisWindow.rb, line 317 def initialize(args=nil) if args.nil? @active = false else @start_date = validate_time(args[:start_date]) @end_date = validate_time(args[:end_date]) @active = true end end
Public Instance Methods
active?()
click to toggle source
If the time frame is active, then start and end dates are defined and functioning
# File models/AnalysisWindow.rb, line 313 def active? active end
validate_time(time)
click to toggle source
Attempt to parse the time string that is entered in the configuration file.
# File models/AnalysisWindow.rb, line 328 def validate_time(time) if time.is_a? Time return time else return Time.parse(time) end end