Be able to specify sheet names that are read for card data in each Cardfile

This commit is contained in:
John Bintz 2014-03-01 11:03:54 -05:00
parent 0c8a377b5f
commit e366b0c1b2
2 changed files with 5 additions and 3 deletions

View File

@ -24,9 +24,9 @@ module SVGGVS
settings
end
def each_card
def each_card(card_sheet_identifier)
doc.each_with_pagename do |name, sheet|
if name['Card Data']
if name[card_sheet_identifier]
headers = sheet.row(1)
(sheet.first_row + 1).upto(sheet.last_row) do |index|

View File

@ -3,9 +3,11 @@ module SVGGVS
attr_accessor :svg_source, :svg_merged_target, :individual_files_path, :on_card_finished
attr_accessor :png_files_path, :png_export_width, :pdf_card_size, :pdf_dpi
attr_accessor :pdf_target, :card_back, :card_size, :target, :post_read_data
attr_accessor :card_sheet_identifier
def initialize
@index = 0
@card_sheet_identifier = "Card Data"
end
def configure
@ -58,7 +60,7 @@ module SVGGVS
settings_from_hash(data_source.settings)
@process = proc do
data_source.each_card do |card|
data_source.each_card(card_sheet_identifier) do |card|
if !!@post_read_data
@post_read_data.call(card)
end