Class: Bai2::BaiFile
- Inherits:
-
Object
- Object
- Bai2::BaiFile
- Extended by:
- AttrReaderFromIvarHash
- Defined in:
- lib/bai2.rb,
lib/bai2/integrity.rb
Overview
This class is the main wrapper around a Bai2 file.
Defined Under Namespace
Classes: Account, Group, IntegrityError, Transaction
Instance Attribute Summary collapse
-
#groups ⇒ Object
readonly
The groups contained within this file.
-
#raw ⇒ Object
readonly
This is the raw data.
Class Method Summary collapse
-
.parse(path) ⇒ Object
Parse a file on disk:.
Instance Method Summary collapse
- #file_creation_datetime ⇒ Object
-
#initialize(raw) ⇒ BaiFile
constructor
Parse a Bai2 data buffer:.
Methods included from AttrReaderFromIvarHash
Constructor Details
Instance Attribute Details
#groups ⇒ Object (readonly)
The groups contained within this file.
37 38 39 |
# File 'lib/bai2.rb', line 37 def groups @groups end |
#raw ⇒ Object (readonly)
This is the raw data. Probably not super important.
34 35 36 |
# File 'lib/bai2.rb', line 34 def raw @raw end |
Class Method Details
.parse(path) ⇒ Object
Parse a file on disk:
f = BaiFile.parse('myfile.bai2')
18 19 20 |
# File 'lib/bai2.rb', line 18 def self.parse(path) self.new(File.read(path)) end |
Instance Method Details
#file_creation_datetime ⇒ Object
49 50 51 |
# File 'lib/bai2.rb', line 49 def file_creation_datetime @header[:file_creation_date] + @header[:file_creation_time] end |