Class: BinaryPList::Parser::BPList00
- Inherits:
-
ObjectReaders::Base
- Object
- ObjectReaders::Base
- BinaryPList::Parser::BPList00
- Defined in:
- lib/binary_plist/parser/bplist00.rb
Constant Summary collapse
- MAGIC =
"bplist00"
- NotBPList00 =
Class.new(StandardError)
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(io) ⇒ BPList00
constructor
A new instance of BPList00.
- #parse ⇒ Object
Methods inherited from ObjectReaders::Base
Constructor Details
#initialize(io) ⇒ BPList00
Returns a new instance of BPList00.
31 32 33 34 35 36 37 |
# File 'lib/binary_plist/parser/bplist00.rb', line 31 def initialize(io) io = StringIO.new(io) if io.is_a? String raise NotBPList00 unless io.read(MAGIC.length).eql? MAGIC @io = io super(self.class, io, nil, nil) end |
Class Method Details
.readers ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/binary_plist/parser/bplist00.rb', line 17 def readers @readers ||= [ ObjectReaders::ASCIIString, ObjectReaders::Array, ObjectReaders::Int, ObjectReaders::Null, ObjectReaders::UTF16String, ] end |
Instance Method Details
#parse ⇒ Object
39 40 41 |
# File 'lib/binary_plist/parser/bplist00.rb', line 39 def parse object(trailer.top_object) end |