Module: TemporalObject
- Defined in:
- lib/temporal_object.rb,
lib/temporal_object/version.rb
Overview
Constant Summary collapse
- VERSION =
"0.1.6"
Instance Attribute Summary collapse
-
#temporal_statuses ⇒ Object
- Array
-
of TimeSpan::TimeLine statuses for temporal attributes.
Instance Method Summary collapse
-
#add_timeline(timeline) ⇒ Array
add a timeline to the TemporalObject.
- #initialize ⇒ Object
-
#remove_timeline(timeline) ⇒ TimeSpan::TimeLine?
delete the cited timeline.
-
#remove_timelines ⇒ Array
remove all TimeLine s from the TemporalObject.
Instance Attribute Details
#temporal_statuses ⇒ Object
- Array
-
of TimeSpan::TimeLine statuses for temporal attributes
9 10 11 |
# File 'lib/temporal_object.rb', line 9 def temporal_statuses @temporal_statuses end |
Instance Method Details
#add_timeline(timeline) ⇒ Array
add a timeline to the TemporalObject
19 20 21 22 |
# 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 |
#initialize ⇒ Object
11 12 13 14 |
# File 'lib/temporal_object.rb', line 11 def initialize super @temporal_statuses = [] # Array of TimeSpan::TimeLine end |
#remove_timeline(timeline) ⇒ TimeSpan::TimeLine?
delete the cited timeline
34 35 36 37 |
# 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 ⇒ Array
remove all TimeLine s from the TemporalObject
26 27 28 |
# File 'lib/temporal_object.rb', line 26 def remove_timelines @temporal_statuses = [] end |