Class: Memories::VersionProxy
- Inherits:
-
Object
- Object
- Memories::VersionProxy
- Defined in:
- lib/memories/versions_proxy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#version_number ⇒ Object
readonly
Returns the value of attribute version_number.
Instance Method Summary collapse
-
#initialize(doc, version_number) ⇒ VersionProxy
constructor
A new instance of VersionProxy.
- #instance ⇒ Object
- #milestone? ⇒ Boolean
- #revision ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(doc, version_number) ⇒ VersionProxy
Returns a new instance of VersionProxy.
57 58 59 60 |
# File 'lib/memories/versions_proxy.rb', line 57 def initialize(doc, version_number) @doc = doc @version_number = version_number end |
Instance Attribute Details
#version_number ⇒ Object (readonly)
Returns the value of attribute version_number.
55 56 57 |
# File 'lib/memories/versions_proxy.rb', line 55 def version_number @version_number end |
Instance Method Details
#instance ⇒ Object
74 75 76 |
# File 'lib/memories/versions_proxy.rb', line 74 def instance @instance ||= @doc.dup.revert_to @version_number end |
#milestone? ⇒ Boolean
70 71 72 |
# File 'lib/memories/versions_proxy.rb', line 70 def milestone? @is_milestone ||= @doc.milestones.collect(&:version).include? version end |
#revision ⇒ Object
66 67 68 |
# File 'lib/memories/versions_proxy.rb', line 66 def revision version end |
#version ⇒ Object
62 63 64 |
# File 'lib/memories/versions_proxy.rb', line 62 def version @version ||= @doc.version_id @version_number end |