Class: BinaryPList::Parser::ObjectReaders::Base
- Inherits:
-
Object
- Object
- BinaryPList::Parser::ObjectReaders::Base
- Defined in:
- lib/binary_plist/parser/object_readers/base.rb
Overview
In order for a subclass to be used by Base#read_object, it must do three things: 1) Be included in the main_class.readers 2) Implement .reads?(marker) - which returns true when it can read the
given marker
3) Implement #read(marker) - which reads the given marker.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(main_class, io, offset_table, trailer) ⇒ Base
constructor
A new instance of Base.
-
#read(marker) ⇒ Object
called in subclasses by #read_object.
Constructor Details
#initialize(main_class, io, offset_table, trailer) ⇒ Base
Returns a new instance of Base.
13 14 15 16 17 18 |
# File 'lib/binary_plist/parser/object_readers/base.rb', line 13 def initialize(main_class, io, offset_table, trailer) @main_class = main_class @io = io @offset_table = offset_table @trailer = trailer end |
Instance Method Details
#read(marker) ⇒ Object
called in subclasses by #read_object. at the beginning of #read,, the next byte read by any read calls to #io will be the byte immediately following the marker byte.
25 26 27 |
# File 'lib/binary_plist/parser/object_readers/base.rb', line 25 def read(marker) raise NotImplementedError end |