Class: PaperTrail::RecordHistory Private
- Inherits:
-
Object
- Object
- PaperTrail::RecordHistory
- Defined in:
- lib/mongo_trails/record_history.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents the history of a single record.
Instance Method Summary collapse
-
#index(version) ⇒ Object
private
Returns ordinal position of ‘version` in `sequence`.
-
#initialize(versions, version_class) ⇒ RecordHistory
constructor
private
A new instance of RecordHistory.
Constructor Details
#initialize(versions, version_class) ⇒ RecordHistory
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RecordHistory.
11 12 13 14 |
# File 'lib/mongo_trails/record_history.rb', line 11 def initialize(versions, version_class) @versions = versions @version_class = version_class end |
Instance Method Details
#index(version) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns ordinal position of ‘version` in `sequence`.
18 19 20 |
# File 'lib/mongo_trails/record_history.rb', line 18 def index(version) sequence.to_a.index(version) end |