Class: AsciiImage

Inherits:
Object
  • Object
show all
Defined in:
lib/honeybii/ascii_image.rb

Direct Known Subclasses

ShadedAscii

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image_filename, point_size) ⇒ AsciiImage

Returns a new instance of AsciiImage.



7
8
9
10
11
# File 'lib/honeybii/ascii_image.rb', line 7

def initialize(image_filename, point_size)
  @raw = Magick::ImageList.new(image_filename).first
  @point_size = point_size
  @ascii = ''
end

Instance Attribute Details

#asciiObject

Returns the value of attribute ascii.



5
6
7
# File 'lib/honeybii/ascii_image.rb', line 5

def ascii
  @ascii
end

#rawObject

Returns the value of attribute raw.



4
5
6
# File 'lib/honeybii/ascii_image.rb', line 4

def raw
  @raw
end

Instance Method Details

#to_sObject



13
14
15
16
17
18
19
# File 'lib/honeybii/ascii_image.rb', line 13

def to_s
  unless @ascii.empty?
    @ascii
  else
    super
  end
end