Class: Twb::Analysis::SheetSourcesAnalyzer

Inherits:
Object
  • Object
show all
Includes:
TabTool
Defined in:
lib/twb/analysis/sheets/sheetsourcesanalyzer.rb,
lib/twb/analysis/datasources/datasourceslocationsanalyzer.rb

Instance Attribute Summary collapse

Attributes included from TabTool

#alerts, #docDir, #docfiles, #funcdoc, #id, #licensed, #logfilename, #logger, #loglevel, #properties, #ttdocdir, #type, #uuid

Instance Method Summary collapse

Methods included from TabTool

#addDocFile, #alert, #closeDocFiles, #config, #docFile, #docFileMaxNameLen, #docfilesdoc, #docfilesdocto_s, #emit, #emitCSV, #finis, #hasConfig, #init, #initCSV, #initDocDir, #initLogger, #license=, #licensed?, #loadConfig

Constructor Details

#initializeSheetSourcesAnalyzer

Returns a new instance of SheetSourcesAnalyzer.


28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/twb/analysis/sheets/sheetsourcesanalyzer.rb', line 28

def initialize
  init
  @funcdoc    = {:class=>self.class, :blurb=>'Analyze Worksheet Fields', :description=>nil,}
  #--
  docFileName = docFile('WorksheetFields.csv')
  @sheetFieldsCSV  = CSV.open(docFileName,'w')
  @sheetFieldsCSV  << ['Workbook','Worksheet','Data Source','Data Source (tech)','Field','Field (tech)','Usage']
  addDocFile docFileName, "Workbooks, Worksheets, and the Sheets' Data Sources and Fields"
  #--
  @twbCnt     = 0
  @sheetCnt   = 0
  @fieldsCnt  = 0
end

Instance Attribute Details

#localEmitObject

Returns the value of attribute localEmit


26
27
28
# File 'lib/twb/analysis/sheets/sheetsourcesanalyzer.rb', line 26

def localEmit
  @localEmit
end

Instance Method Details

#metricsObject


42
43
44
45
46
47
48
# File 'lib/twb/analysis/sheets/sheetsourcesanalyzer.rb', line 42

def metrics
  {
    # '# of Workbooks'         => @twbcount,
    '# of Worksheets'        => @sheetCnt,
    '# of Worksheet Fields'  => @fieldsCnt
  }
end

#processTWB(twb) ⇒ Object


50
51
52
53
54
55
56
57
# File 'lib/twb/analysis/sheets/sheetsourcesanalyzer.rb', line 50

def processTWB twb
   @twb = twb
   emit "   -- twb:: #{@twb.name}"
   @twbCnt += 1
   @twbDomainsLoaded = false
   parseSheets
   finis
end