Class: LegacyParser
- Inherits:
-
Object
- Object
- LegacyParser
- Defined in:
- lib/legacyparser.rb
Instance Attribute Summary collapse
-
#con ⇒ Object
Returns the value of attribute con.
-
#img ⇒ Object
Returns the value of attribute img.
Instance Method Summary collapse
-
#initialize(file = nil) ⇒ LegacyParser
constructor
A new instance of LegacyParser.
-
#parse_bmp(info) ⇒ Object
Parse a BMP file.
-
#parse_ppm(info) ⇒ Object
Parse a PPM file.
-
#parse_ptf(info) ⇒ Object
Parse a PTF file.
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
#con ⇒ Object
Returns the value of attribute con.
8 9 10 |
# File 'lib/legacyparser.rb', line 8 def con @con end |
#img ⇒ Object
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 |