Class: Twb::Analysis::DashboardsSummarizer
- Inherits:
-
Object
- Object
- Twb::Analysis::DashboardsSummarizer
- Includes:
- TabTool
- Defined in:
- lib/twb/analysis/sheets/dashboardsummarizer.rb
Instance Attribute Summary collapse
-
#localEmit ⇒ Object
Returns the value of attribute localEmit.
Attributes included from TabTool
#alerts, #docDir, #docfiles, #funcdoc, #id, #licensed, #logfilename, #logger, #loglevel, #properties, #ttdocdir, #type, #uuid
Instance Method Summary collapse
-
#initialize(**args) ⇒ DashboardsSummarizer
constructor
A new instance of DashboardsSummarizer.
- #metrics ⇒ Object
- #parseDashes ⇒ Object
- #processTWB(twb) ⇒ Object
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
#initialize(**args) ⇒ DashboardsSummarizer
Returns a new instance of DashboardsSummarizer.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/twb/analysis/sheets/dashboardsummarizer.rb', line 28 def initialize(**args) @args = args @recordDir = !@args.nil? && @args[:recordDir] == true @ttdocdir = @args[:ttdocdir] @csvAdd = !@args.nil? && args[:csvMode] == :add @csvMode = @csvAdd ? 'a' : 'w' init @funcdoc = {:class=>self.class, :blurb=>'Analyze Dashboard Worksheets', :description=>'Identifies the Worksheets present in Dashboards.',} #-- docFileName = docFile('DashboardSummaries.csv') @dashboardsCSV = CSV.open(docFileName,@csvMode) unless @csvAdd if @recordDir @dashboardsCSV << ['Rec #','Workbook','Dashboard','# Worksheets','Workbook Dir'] else @dashboardsCSV << ['Rec #','Workbook','Dashboard','# Worksheets' ] end end addDocFile @dashboardsCSV, docFileName, "Workbooks and their Dashboards' summaries" #-- @twbCount = 0 @dashCount = 0 @recNum = 0 end |
Instance Attribute Details
#localEmit ⇒ Object
Returns the value of attribute localEmit.
26 27 28 |
# File 'lib/twb/analysis/sheets/dashboardsummarizer.rb', line 26 def localEmit @localEmit end |
Instance Method Details
#metrics ⇒ Object
53 54 55 56 57 58 |
# File 'lib/twb/analysis/sheets/dashboardsummarizer.rb', line 53 def metrics { # '# of Workbooks' => @twbCount, '# of Dashboards' => @dashCount, } end |
#parseDashes ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/twb/analysis/sheets/dashboardsummarizer.rb', line 71 def parseDashes @dashboards = @twb.dashboards @dashboards.each do |dash| emit "DASH:: #{dash.name}" @dashCount += 1 recordCSV [@twbName, dash.name, dash.worksheets.length] end end |
#processTWB(twb) ⇒ Object
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/twb/analysis/sheets/dashboardsummarizer.rb', line 60 def processTWB twb @twb = twb @twbName = @twb.name @twbDir = @twb.dir @modTime = @twb.modtime emit " -- #{@twbName}" @twbCount += 1 parseDashes finis end |