Class: WhirledPeas::Command::Play::FilePlayer

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

Instance Method Summary collapse

Constructor Details

#initialize(wpz_file) ⇒ FilePlayer

Returns a new instance of FilePlayer.



51
52
53
# File 'lib/whirled_peas/command/play.rb', line 51

def initialize(wpz_file)
  @wpz_file = wpz_file
end

Instance Method Details

#playObject



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/whirled_peas/command/play.rb', line 55

def play
  require 'whirled_peas/device/screen'
  require 'whirled_peas/utils/ansi'
  require 'whirled_peas/utils/file_handler'

  Utils::Ansi.with_screen do
    screen = Device::Screen.new
    rendered_frames = Utils::FileHandler.read(wpz_file)
    screen.handle_rendered_frames(rendered_frames)
  end
end