Class: FastVersioning::Timeline
- Inherits:
-
Object
- Object
- FastVersioning::Timeline
- Defined in:
- lib/fast_versioning/timeline.rb
Overview
a timeline for a tracked property
Instance Method Summary collapse
-
#initialize(fast_versions:, name:) ⇒ Timeline
constructor
A new instance of Timeline.
-
#to_h ⇒ Hash
Hash of duration => date ranges.
Constructor Details
#initialize(fast_versions:, name:) ⇒ Timeline
Returns a new instance of Timeline.
7 8 9 10 |
# File 'lib/fast_versioning/timeline.rb', line 7 def initialize(fast_versions:, name:) self.fast_versions = fast_versions self.name = name end |
Instance Method Details
#to_h ⇒ Hash
Returns hash of duration => date ranges.
23 24 25 26 27 |
# File 'lib/fast_versioning/timeline.rb', line 23 def to_h durations_array.map do |duration| [duration.date_range, duration.value] end.to_h end |