Class: Officedoc::Package::Raw

Inherits:
Object
  • Object
show all
Defined in:
lib/officedoc/package/raw.rb,
lib/officedoc/package/raw/parts.rb,
lib/officedoc/package/raw/parts.rb,
lib/officedoc/package/raw/ruby_zip_engine.rb

Defined Under Namespace

Classes: Part, PartList, RubyZipEngine

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream, zip_engine: ::Officedoc::Package::Raw::RubyZipEngine) ⇒ Raw

Returns a new instance of Raw.



10
11
12
13
# File 'lib/officedoc/package/raw.rb', line 10

def initialize( stream, zip_engine: ::Officedoc::Package::Raw::RubyZipEngine )
  @zip_engine = zip_engine
  @stream = stream
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



8
9
10
# File 'lib/officedoc/package/raw.rb', line 8

def stream
  @stream
end

#zip_engineObject (readonly)

Returns the value of attribute zip_engine.



7
8
9
# File 'lib/officedoc/package/raw.rb', line 7

def zip_engine
  @zip_engine
end

Instance Method Details

#document_typeObject



24
25
26
# File 'lib/officedoc/package/raw.rb', line 24

def document_type
  @document_type ||= get_document_type
end

#file_namesObject



18
19
20
# File 'lib/officedoc/package/raw.rb', line 18

def file_names
  zip_file.entries.map(&:name)
end

#partsObject



21
22
23
# File 'lib/officedoc/package/raw.rb', line 21

def parts
  @parts ||= PartList.new zip_file
end