Class: EtherpadLite::Diff
- Inherits:
-
Object
- Object
- EtherpadLite::Diff
- Defined in:
- lib/etherpad-lite/models/diff.rb
Overview
Represents a diff between two Pad revisions.
Instance Attribute Summary collapse
-
#end_rev ⇒ Object
Diff end revision.
-
#instance ⇒ Object
The EtherpadLite::Instance object.
-
#pad ⇒ Object
The EtherpadLite::Pad object.
-
#start_rev ⇒ Object
Diff start revision.
Instance Method Summary collapse
-
#author_ids ⇒ Object
Returns the IDs of the authors who were involved in the diff.
-
#authors ⇒ Object
Returns Authors who were involved in the diff.
-
#html ⇒ Object
Returns the diff as html.
-
#initialize(pad, start_rev, end_rev = nil) ⇒ Diff
constructor
If end_rev is not specified, the latest revision will be used.
Constructor Details
#initialize(pad, start_rev, end_rev = nil) ⇒ Diff
If end_rev is not specified, the latest revision will be used
14 15 16 17 18 19 |
# File 'lib/etherpad-lite/models/diff.rb', line 14 def initialize(pad, start_rev, end_rev=nil) @instance = pad.instance @pad = pad @start_rev = start_rev @end_rev = end_rev || pad.revision_numbers.last end |
Instance Attribute Details
#end_rev ⇒ Object
Diff end revision
11 12 13 |
# File 'lib/etherpad-lite/models/diff.rb', line 11 def end_rev @end_rev end |
#instance ⇒ Object
The EtherpadLite::Instance object
5 6 7 |
# File 'lib/etherpad-lite/models/diff.rb', line 5 def instance @instance end |
#pad ⇒ Object
The EtherpadLite::Pad object
7 8 9 |
# File 'lib/etherpad-lite/models/diff.rb', line 7 def pad @pad end |
#start_rev ⇒ Object
Diff start revision
9 10 11 |
# File 'lib/etherpad-lite/models/diff.rb', line 9 def start_rev @start_rev end |
Instance Method Details
#author_ids ⇒ Object
Returns the IDs of the authors who were involved in the diff
27 28 29 |
# File 'lib/etherpad-lite/models/diff.rb', line 27 def diff[:authors] end |
#authors ⇒ Object
Returns Authors who were involved in the diff
32 33 34 |
# File 'lib/etherpad-lite/models/diff.rb', line 32 def @authors ||= .map { |id| Author.new(instance, id) } end |
#html ⇒ Object
Returns the diff as html
22 23 24 |
# File 'lib/etherpad-lite/models/diff.rb', line 22 def html diff[:html] end |