require_relative 'worksheet' module Smerp module Exporter module Excel class Workbook attr_reader :inst attr_accessor :config def initialize(wb, config) @inst = wb @config = config @wsRec = {} end def worksheet(name, *args, &block) ws = @inst.add_worksheet(name: name) wsProxy = Worksheet.new(ws, @config) @wsRec[name] = wsProxy if block block.call(wsProxy) else ws end end def config=(conf) @config = conf @wsRec.each do |k,v| v.config = conf end end def method_missing(mtd, *args, &block) @inst.send(mtd, *args, &block) end end end end end