Class: RETerm::Components::Image

Inherits:
RETerm::Component show all
Defined in:
lib/reterm/components/image.rb

Overview

Renders and image to the screen using drawille and chunkpng.

Instance Attribute Summary

Attributes inherited from RETerm::Component

#window

Instance Method Summary collapse

Methods inherited from RETerm::Component

#activatable?, #activate!, #colored?, #colors=, #finalize!

Constructor Details

#initialize(args = {}) ⇒ Image

Initialize the Image component

Parameters:

  • args (Hash) (defaults to: {})

    image params

Options Hash (args):

  • :file (String)

    path to the file containing the image



11
12
13
# File 'lib/reterm/components/image.rb', line 11

def initialize(args={})
  @file = args[:file]
end

Instance Method Details

#draw!Object



15
16
17
# File 'lib/reterm/components/image.rb', line 15

def draw!
  refresh_win
end