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.
25 lines
383 B
Ruby
25 lines
383 B
Ruby
11 years ago
|
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
|