Module: TimeTravel::TimelineHelper::ClassMethods
- Defined in:
- lib/time_travel/timeline_helper.rb
Instance Attribute Summary collapse
-
#enum_fields ⇒ Object
Returns the value of attribute enum_fields.
-
#enum_items ⇒ Object
Returns the value of attribute enum_items.
Instance Method Summary collapse
Instance Attribute Details
#enum_fields ⇒ Object
Returns the value of attribute enum_fields.
26 27 28 |
# File 'lib/time_travel/timeline_helper.rb', line 26 def enum_fields @enum_fields end |
#enum_items ⇒ Object
Returns the value of attribute enum_items.
26 27 28 |
# File 'lib/time_travel/timeline_helper.rb', line 26 def enum_items @enum_items end |
Instance Method Details
#enum_info ⇒ Object
36 37 38 39 40 |
# File 'lib/time_travel/timeline_helper.rb', line 36 def enum_info self.enum_items ||= self.defined_enums.symbolize_keys self.enum_fields ||= self.enum_items.keys [self.enum_fields, self.enum_items] end |
#timeline(**timeline_identifiers) ⇒ Object
32 33 34 |
# File 'lib/time_travel/timeline_helper.rb', line 32 def timeline(**timeline_identifiers) Timeline.new(self,timeline_identifiers) end |
#timeline_fields ⇒ Object
28 29 30 |
# File 'lib/time_travel/timeline_helper.rb', line 28 def timeline_fields raise "timeline_fields should be defined to return the list of fields which identify a timeline in the record" end |