Class: Sftui::FrameBuffer

Inherits:
Object
  • Object
show all
Defined in:
lib/sftui/frame_buffer.rb

Instance Method Summary collapse

Constructor Details

#initializeFrameBuffer

Returns a new instance of FrameBuffer.



7
8
9
# File 'lib/sftui/frame_buffer.rb', line 7

def initialize
  @buffer = []
end

Instance Method Details

#latest_frameObject



11
12
13
# File 'lib/sftui/frame_buffer.rb', line 11

def latest_frame
  @buffer[-1]
end

#pop(frame) ⇒ Object



19
20
21
# File 'lib/sftui/frame_buffer.rb', line 19

def pop(frame)
  @buffer -= [frame]
end

#push(frame) ⇒ Object



15
16
17
# File 'lib/sftui/frame_buffer.rb', line 15

def push(frame)
  @buffer << frame
end