Class: FrameDiff

Inherits:
Object
  • Object
show all
Defined in:
lib/asciinema/frame_diff.rb

Instance Method Summary collapse

Constructor Details

#initialize(line_changes, cursor_changes) ⇒ FrameDiff

Returns a new instance of FrameDiff.



3
4
5
6
# File 'lib/asciinema/frame_diff.rb', line 3

def initialize(line_changes, cursor_changes)
  @line_changes = line_changes
  @cursor_changes = cursor_changes
end

Instance Method Details

#as_jsonObject



8
9
10
11
12
13
14
# File 'lib/asciinema/frame_diff.rb', line 8

def as_json(*)
  json = {}
  json[:lines] = line_changes unless line_changes.blank?
  json[:cursor] = cursor_changes unless cursor_changes.blank?

  json
end