Class: NWN::Gff::Reader
- Inherits:
-
Object
- Object
- NWN::Gff::Reader
- Includes:
- NWN::Gff
- Defined in:
- lib/nwn/gff/reader.rb
Overview
A class that parses binary GFF bytes into ruby-friendly data structures.
Constant Summary
Constants included from NWN::Gff
ComplexTypes, FileFormatGuesses, Formats, InputFormats, OutputFormats, SimpleTypes, Types
Instance Attribute Summary collapse
-
#root_struct ⇒ Object
readonly
Returns the value of attribute root_struct.
Class Method Summary collapse
-
.read(io) ⇒ Object
Create a new Reader with the given
io
and immediately parse it.
Instance Method Summary collapse
-
#initialize(io) ⇒ Reader
constructor
:nodoc:.
Methods included from NWN::Gff
Constructor Details
#initialize(io) ⇒ Reader
:nodoc:
15 16 17 18 19 |
# File 'lib/nwn/gff/reader.rb', line 15 def initialize io #:nodoc: @io = io io.internal_encoding == nil or raise "passed io needs to be binary, is #{io.internal_encoding.inspect}" read_all end |
Instance Attribute Details
#root_struct ⇒ Object (readonly)
Returns the value of attribute root_struct.
5 6 7 |
# File 'lib/nwn/gff/reader.rb', line 5 def root_struct @root_struct end |
Class Method Details
.read(io) ⇒ Object
Create a new Reader with the given io
and immediately parse it.
10 11 12 13 |
# File 'lib/nwn/gff/reader.rb', line 10 def self.read io t = new(io) t.root_struct end |