class Xsv::SheetsIdsHandler

SheetsIdsHandler interprets the relevant parts of workbook.xml This is used internally to get the sheets ids, relationship_ids, and names when opening a workbook.

Public Class Methods

get_sheets_ids(io) click to toggle source
# File lib/xsv/sheets_ids_handler.rb, line 7
def self.get_sheets_ids(io)
  sheets_ids = []

  new { |sheet_ids| sheets_ids << sheet_ids }.parse(io)

  sheets_ids
end
new(&block) click to toggle source
# File lib/xsv/sheets_ids_handler.rb, line 15
def initialize(&block)
  @block = block
end

Public Instance Methods

start_element(name, attrs) click to toggle source
# File lib/xsv/sheets_ids_handler.rb, line 19
def start_element(name, attrs)
  @block.call(attrs.slice(:name, :sheetId, :state, :'r:id')) if name == 'sheet'
end