2013-07-09 21:40:21 +00:00
|
|
|
class Snapshot
|
2013-07-25 16:02:58 +00:00
|
|
|
|
2013-07-09 21:40:21 +00:00
|
|
|
attr_reader :lines
|
|
|
|
|
|
|
|
def initialize(lines = [])
|
|
|
|
@lines = lines
|
|
|
|
end
|
|
|
|
|
|
|
|
def ==(other)
|
|
|
|
other.lines == lines
|
|
|
|
end
|
|
|
|
|
2013-07-25 16:02:58 +00:00
|
|
|
def crop(width, height)
|
|
|
|
new_lines = lines.drop(lines.size - height).map { |line| line.crop(width) }
|
|
|
|
self.class.new(new_lines)
|
2013-07-09 21:40:21 +00:00
|
|
|
end
|
2013-07-25 16:02:58 +00:00
|
|
|
|
2013-07-09 21:40:21 +00:00
|
|
|
end
|