You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/app/models/frame.rb

25 lines
383 B
Ruby

class Frame
attr_reader :snapshot, :cursor
def initialize(snapshot, cursor)
@snapshot = snapshot
@cursor = cursor
end
def diff(other)
FrameDiff.new(snapshot_diff(other), cursor_diff(other))
end
private
def snapshot_diff(other)
snapshot.diff(other && other.snapshot)
end
def cursor_diff(other)
cursor.diff(other && other.cursor)
end
end