2013-09-10 19:29:17 +00:00
|
|
|
class FrameDiff
|
|
|
|
|
|
|
|
def initialize(line_changes, cursor_changes)
|
|
|
|
@line_changes = line_changes
|
|
|
|
@cursor_changes = cursor_changes
|
|
|
|
end
|
|
|
|
|
|
|
|
def as_json(*)
|
|
|
|
json = {}
|
2013-09-15 12:47:15 +00:00
|
|
|
json[:lines] = line_changes unless line_changes.blank?
|
2013-09-10 19:29:17 +00:00
|
|
|
json[:cursor] = cursor_changes unless cursor_changes.blank?
|
|
|
|
|
|
|
|
json
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
attr_reader :line_changes, :cursor_changes
|
|
|
|
|
|
|
|
end
|