Class: RubyXL::GenericStorageObject
- Inherits:
-
Object
- Object
- RubyXL::GenericStorageObject
- Defined in:
- lib/rubyXL/objects/storage.rb
Direct Known Subclasses
ActiveX, ActiveXBinary, BinaryImageFile, ChartColorsFile, ChartFile, ChartStyleFile, ChartUserShapesFile, ControlPropertiesFile, CustomPropertiesFile, CustomPropertyFile, CustomXMLFile, DrawingFile, HyperlinkRelFile, MacrosFile, OLEObjectFile, PersonMetadata, PivotCacheDefinitionFile, PivotCacheRecordsFile, PivotTableFile, PrinterSettingsFile, SheetMetadata, SlicerCacheFile, SlicerFile, TableFile, ThumbnailFile, VMLDrawingFile
Constant Summary collapse
- SAVE_ORDER =
0
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#generic_storage ⇒ Object
Returns the value of attribute generic_storage.
-
#xlsx_path ⇒ Object
Returns the value of attribute xlsx_path.
Class Method Summary collapse
Instance Method Summary collapse
- #add_to_zip(zip_stream) ⇒ Object
-
#initialize(file_path, data) ⇒ GenericStorageObject
constructor
A new instance of GenericStorageObject.
Constructor Details
permalink #initialize(file_path, data) ⇒ GenericStorageObject
Returns a new instance of GenericStorageObject.
7 8 9 10 11 |
# File 'lib/rubyXL/objects/storage.rb', line 7 def initialize(file_path, data) @xlsx_path = file_path @data = data @generic_storage = [] end |
Instance Attribute Details
permalink #data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/rubyXL/objects/storage.rb', line 5 def data @data end |
permalink #generic_storage ⇒ Object
Returns the value of attribute generic_storage.
5 6 7 |
# File 'lib/rubyXL/objects/storage.rb', line 5 def generic_storage @generic_storage end |
permalink #xlsx_path ⇒ Object
Returns the value of attribute xlsx_path.
5 6 7 |
# File 'lib/rubyXL/objects/storage.rb', line 5 def xlsx_path @xlsx_path end |
Class Method Details
permalink .parse_file(zip_file, file_path) ⇒ Object
[View source]
13 14 15 |
# File 'lib/rubyXL/objects/storage.rb', line 13 def self.parse_file(zip_file, file_path) (entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream(&:read)) end |
Instance Method Details
permalink #add_to_zip(zip_stream) ⇒ Object
[View source]
17 18 19 20 21 22 |
# File 'lib/rubyXL/objects/storage.rb', line 17 def add_to_zip(zip_stream) return false if @data.nil? zip_stream.put_next_entry(RubyXL::from_root(self.xlsx_path)) zip_stream.write(@data) true end |