module TemporalObject
@author Craig A. Cook
Constants
- VERSION
Attributes
temporal_statuses[RW]
- Array
-
of TimeSpan::TimeLine statuses for temporal attributes
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/temporal_object.rb, line 11 def initialize super @temporal_statuses = [] # Array of TimeSpan::TimeLine end
Public Instance Methods
add_timeline(timeline)
click to toggle source
add a timeline to the TemporalObject
@param [TimeSpan::TimeLine] timeline added to the object @return [Array] adjusted list of timelines if no exception raised.
# File lib/temporal_object.rb, line 19 def add_timeline(timeline) raise ArgumentError, "Can only add a TimeSpan::TimeLine to a TemporalObject's statuses" unless timeline.kind_of? TimeSpan::TimeLine @temporal_statuses << timeline end
remove_timeline(timeline)
click to toggle source
delete the cited timeline @param timeline [TimeSpan::TimeLine] timeline to delete @raise ArgumentError if called with a non-TimeLine object @return [TimeSpan::TimeLine, nil] TimeLIne deleted if successful or nil if not
# File lib/temporal_object.rb, line 34 def remove_timeline(timeline) raise ArgumentError, "Can only remove a TimeLine with this call." unless timeline.kind_of? TimeSpan::TimeLine @temporal_statuses.delete(timeline) end
remove_timelines()
click to toggle source
remove all TimeLine s from the TemporalObject
@return [Array] the associated timelines
# File lib/temporal_object.rb, line 26 def remove_timelines @temporal_statuses = [] end