Class: Officedoc::Package::Raw::Part
- Inherits:
-
Object
- Object
- Officedoc::Package::Raw::Part
- Defined in:
- lib/officedoc/package/raw/parts.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(zip_file, xml_node) ⇒ Part
constructor
A new instance of Part.
- #read_stream(&block) ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/officedoc/package/raw/parts.rb', line 8 def name @name end |
#type ⇒ Object (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 |