Class: WhirledPeas::Command::Still

Inherits:
FrameCommand
  • Object
show all
Defined in:
lib/whirled_peas/command/still.rb

Overview

Display a still frame with the specified arguments.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject



9
10
11
# File 'lib/whirled_peas/command/still.rb', line 9

def self.description
  'Show the specified still frame'
end

Instance Method Details

#startObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/whirled_peas/command/still.rb', line 13

def start
  super

  require 'whirled_peas/device/screen'
  require 'whirled_peas/graphics/renderer'
  require 'whirled_peas/utils/ansi'

  Utils::Ansi.with_screen do |width, height|
    strokes = Graphics::Renderer.new(
      WhirledPeas.config.template_factory.build(frame, frame_args),
      width,
      height
    ).paint
    Device::Screen.new.handle_rendered_frames(
      [Device::RenderedFrame.new(strokes, 0)]
    )
  end
end