Class: DoctorNinja::Document
- Inherits:
-
Object
- Object
- DoctorNinja::Document
- Defined in:
- lib/doctor_ninja/document.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(file) ⇒ Document
constructor
A new instance of Document.
- #numbering ⇒ Object
- #read(file) ⇒ Object
- #relationships ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(file) ⇒ Document
Returns a new instance of Document.
8 9 10 11 12 |
# File 'lib/doctor_ninja/document.rb', line 8 def initialize file @file = Zip::File.new(file) rescue Zip::Error raise InvalidDocumentError.new end |
Instance Method Details
#close ⇒ Object
30 31 32 |
# File 'lib/doctor_ninja/document.rb', line 30 def close @file.close end |
#numbering ⇒ Object
18 19 20 |
# File 'lib/doctor_ninja/document.rb', line 18 def numbering @numbering ||= DoctorNinja::Numbering.new(self) end |
#read(file) ⇒ Object
22 23 24 |
# File 'lib/doctor_ninja/document.rb', line 22 def read file @file.read(file) end |
#relationships ⇒ Object
14 15 16 |
# File 'lib/doctor_ninja/document.rb', line 14 def relationships @relationships ||= DoctorNinja::Relationships.new(self) end |
#to_html ⇒ Object
26 27 28 |
# File 'lib/doctor_ninja/document.rb', line 26 def to_html DoctorNinja::Parser.new(self).parse end |