Class: Sftui::FrameBuffer
- Inherits:
-
Object
- Object
- Sftui::FrameBuffer
- Defined in:
- lib/sftui/frame_buffer.rb
Instance Method Summary collapse
-
#initialize ⇒ FrameBuffer
constructor
A new instance of FrameBuffer.
- #latest_frame ⇒ Object
- #pop(frame) ⇒ Object
- #push(frame) ⇒ Object
Constructor Details
#initialize ⇒ FrameBuffer
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_frame ⇒ Object
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 |