class RubyXL::GenericStorageObject

Constants

SAVE_ORDER

Attributes

data[RW]
generic_storage[RW]
xlsx_path[RW]

Public Class Methods

new(file_path, data) click to toggle source
# File lib/rubyXL/objects/storage.rb, line 8
def initialize(file_path, data)
  @xlsx_path = file_path
  @data = data
  @generic_storage = []
end
parse_file(zip_file, file_path) click to toggle source
# File lib/rubyXL/objects/storage.rb, line 14
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 { |f| f.read })
end

Public Instance Methods

add_to_zip(zip_stream) click to toggle source
# File lib/rubyXL/objects/storage.rb, line 18
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