Class: Twb::Analysis::GroupFieldsAnalyzer
- Inherits:
-
Object
- Object
- Twb::Analysis::GroupFieldsAnalyzer
- Includes:
- TabTool
- Defined in:
- lib/twb/analysis/calculatedfields/groupfieldsanalyzer.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 ⇒ GroupFieldsAnalyzer
constructor
A new instance of GroupFieldsAnalyzer.
- #initMarkdown ⇒ Object
- #metrics ⇒ Object
- #parseDataSources ⇒ 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 ⇒ GroupFieldsAnalyzer
Returns a new instance of GroupFieldsAnalyzer.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/twb/analysis/calculatedfields/groupfieldsanalyzer.rb', line 28 def initialize init @funcdoc = {:class=>self.class, :blurb=>'Analyze Group Fields.', :description=>'Identifies the Groups and their Members for grouped fields.',} #-- docFileName = docFile('GroupFields.csv') @csv = CSV.open(docFileName,'w') @csv << ['Workbook','Data Source','Field','Group','Member'] addDocFile @csv, docFileName, "Workbooks, Data Sources, and their Grouped Fields" #-- @twbCount = 0 @dsCount = 0 @gfCount = 0 @gfmCount = 0 end |
Instance Attribute Details
#localEmit ⇒ Object
Returns the value of attribute localEmit.
26 27 28 |
# File 'lib/twb/analysis/calculatedfields/groupfieldsanalyzer.rb', line 26 def localEmit @localEmit end |
Instance Method Details
#initMarkdown ⇒ Object
63 64 65 66 |
# File 'lib/twb/analysis/calculatedfields/groupfieldsanalyzer.rb', line 63 def initMarkdown $mdFile = File.open(docFile("#{@twbName}.GroupFields.md"), 'w') $mdFile << "# #{@twbName}\n " end |
#metrics ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/twb/analysis/calculatedfields/groupfieldsanalyzer.rb', line 43 def metrics { # '# of Workbooks' => @twbCount, '# of Data Sources' => @dsCount, '# of Group Fields' => @gfCount, '# of Group Field Members' => @gfmCount } end |
#parseDataSources ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/twb/analysis/calculatedfields/groupfieldsanalyzer.rb', line 68 def parseDataSources @twb.datasources.each do |ds| $mdFile.puts "\n## #{ds.uiname}" @dsCount += 1 cfs = ds.calculatedFields cfs.each do |cf| if cf.isGroup @gfCount += 1 $mdFile.puts "### #{cf.name}" cf.groupMembers.each do |lead,values| $mdFile.puts "* #{lead}" values.each do |v| @gfmCount += 1 $mdFile.puts " > #{v}" @csv << [@twbName, ds.uiname,cf.uiname,lead,v] end end end end end end |
#processTWB(twb) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/twb/analysis/calculatedfields/groupfieldsanalyzer.rb', line 52 def processTWB twb @twb = twb @twbName = @twb.name emit " -- #{@twbName}" @twbCount += 1 initMarkdown parseDataSources finis $mdFile.close unless $mdFile.nil? end |