Class: Officedoc::Package::Raw::Part

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(zip_file, xml_node) ⇒ Part

Returns a new instance of Part.



11
12
13
14
15
# File 'lib/officedoc/package/raw/parts.rb', line 11

def initialize(zip_file,xml_node)
  @name = xml_node["PartName"]
  @type = xml_node["ContentType"]
  @zip_file = zip_file
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#read_stream(&block) ⇒ Object



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

def read_stream(&block)
  @zip_file.entry_read_stream(file_name,&block)
end