Class: LegacyParser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file = nil) ⇒ LegacyParser

Returns a new instance of LegacyParser.



9
10
11
12
# File 'lib/legacyparser.rb', line 9

def initialize(file=nil)
	@img = ImageParser.new(file) if file
	@con = File.read(file, mode: 'rb') if file
end

Instance Attribute Details

#conObject

Returns the value of attribute con.



8
9
10
# File 'lib/legacyparser.rb', line 8

def con
  @con
end

#imgObject

Returns the value of attribute img.



8
9
10
# File 'lib/legacyparser.rb', line 8

def img
  @img
end

Instance Method Details

#parse_bmp(info) ⇒ Object

Parse a BMP file.

unfinished..



31
32
33
# File 'lib/legacyparser.rb', line 31

def parse_bmp(info)
	# to do..
end

#parse_ppm(info) ⇒ Object

Parse a PPM file.

See ImageParser docs for more.



17
18
19
# File 'lib/legacyparser.rb', line 17

def parse_ppm(info)
	@img.parse_ppm(info)
end

#parse_ptf(info) ⇒ Object

Parse a PTF file.

See ImageParser docs for more.



24
25
26
# File 'lib/legacyparser.rb', line 24

def parse_ptf(info)
	@img.parse_ppm(info)
end