Class: Flow::Flow
- Inherits:
-
TabClass
- Object
- TabClass
- Flow::Flow
- Defined in:
- lib/tfl/Flow.rb
Overview
A Tableau Prep Flow file.
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#build ⇒ Object
readonly
Returns the value of attribute build.
-
#datasource(name) ⇒ Object
readonly
–.
-
#datasourceNames ⇒ Object
readonly
Returns the value of attribute datasourceNames.
-
#dataSourceNamesMap ⇒ Object
readonly
Returns the value of attribute dataSourceNamesMap.
-
#datasources ⇒ Object
readonly
–.
-
#datasourceUINames ⇒ Object
readonly
Returns the value of attribute datasourceUINames.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#modtime ⇒ Object
readonly
Returns the value of attribute modtime.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #actionNames ⇒ Object
- #actions ⇒ Object
- #dashboard(name) ⇒ Object
- #dashboardNames ⇒ Object
- #dashboards ⇒ Object
- #id ⇒ Object
-
#initialize(tflWithDir) ⇒ Flow
constructor
Creates a Flow from its file name.
- #orphanDataSources ⇒ Object
- #parameters ⇒ Object
- #release ⇒ Object
- #storyboard(name) ⇒ Object
- #storyboardNames ⇒ Object
- #storyboards ⇒ Object
- #worksheet(name) ⇒ Object
- #worksheetNames ⇒ Object
- #worksheets ⇒ Object
Constructor Details
#initialize(tflWithDir) ⇒ Flow
Creates a Flow from its file name.
Parameters:
flowWithDir
The Flow's file name, the Flow can be a TWB or TWBX file.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/tfl/Flow.rb', line 47 def initialize tflWithDir raise ArgumentError.new("ERROR in Flow creation: '#{tflWithDir}' must be a String, is a #{tflWithDir.class} \n ") unless tflWithDir.is_a? String raise ArgumentError.new("ERROR in Flow creation: '#{tflWithDir}' must have an extension of .tfl or .tflx \n ") unless tflWithDir.upcase.end_with?(".TFL", ".TFLX") raise ArgumentError.new("ERROR in Flow creation: '#{tflWithDir}' must must be a file, is a Directory\\Folder \n ") if File.directory?(tflWithDir) raise ArgumentError.new("ERROR in Flow creation: '#{tflWithDir}' cannot be found, must be a Tableau Flow file. \n ") unless File.file?(tflWithDir) @valid = false if File.file?(tflWithDir) then @name = File.basename(tflWithDir) @dir = File.dirname(File.(tflWithDir)) @modtime = File.new(tflWithDir).mtime.strftime("%Y-%m-%d %H:%M:%S") case File.extname(tflWithDir).downcase when '.tlf' then processTFL(tflWithDir) when '.tflx' then processTFLX(flowWithDir) end end end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
29 30 31 |
# File 'lib/tfl/Flow.rb', line 29 def base @base end |
#build ⇒ Object (readonly)
Returns the value of attribute build.
29 30 31 |
# File 'lib/tfl/Flow.rb', line 29 def build @build end |
#datasource(name) ⇒ Object (readonly)
–
32 33 34 |
# File 'lib/tfl/Flow.rb', line 32 def datasource @datasource end |
#datasourceNames ⇒ Object (readonly)
Returns the value of attribute datasourceNames.
33 34 35 |
# File 'lib/tfl/Flow.rb', line 33 def datasourceNames @datasourceNames end |
#dataSourceNamesMap ⇒ Object (readonly)
Returns the value of attribute dataSourceNamesMap.
33 34 35 |
# File 'lib/tfl/Flow.rb', line 33 def dataSourceNamesMap @dataSourceNamesMap end |
#datasources ⇒ Object (readonly)
–
32 33 34 |
# File 'lib/tfl/Flow.rb', line 32 def datasources @datasources end |
#datasourceUINames ⇒ Object (readonly)
Returns the value of attribute datasourceUINames.
33 34 35 |
# File 'lib/tfl/Flow.rb', line 33 def datasourceUINames @datasourceUINames end |
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
28 29 30 |
# File 'lib/tfl/Flow.rb', line 28 def dir @dir end |
#modtime ⇒ Object (readonly)
Returns the value of attribute modtime.
28 29 30 |
# File 'lib/tfl/Flow.rb', line 28 def modtime @modtime end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/tfl/Flow.rb', line 28 def name @name end |
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
29 30 31 |
# File 'lib/tfl/Flow.rb', line 29 def platform @platform end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
30 31 32 |
# File 'lib/tfl/Flow.rb', line 30 def root @root end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
28 29 30 |
# File 'lib/tfl/Flow.rb', line 28 def type @type end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
29 30 31 |
# File 'lib/tfl/Flow.rb', line 29 def version @version end |
Instance Method Details
#actionNames ⇒ Object
104 105 106 |
# File 'lib/tfl/Flow.rb', line 104 def actionNames @actions.keys end |
#actions ⇒ Object
100 101 102 |
# File 'lib/tfl/Flow.rb', line 100 def actions @actions.values end |
#dashboard(name) ⇒ Object
96 97 98 |
# File 'lib/tfl/Flow.rb', line 96 def dashboard name @dashboards[name] end |
#dashboardNames ⇒ Object
92 93 94 |
# File 'lib/tfl/Flow.rb', line 92 def dashboardNames @dashboards.keys end |
#dashboards ⇒ Object
88 89 90 |
# File 'lib/tfl/Flow.rb', line 88 def dashboards @dashboards.values end |
#id ⇒ Object
64 65 66 |
# File 'lib/tfl/Flow.rb', line 64 def id @id ||= @id = @name.hash end |
#orphanDataSources ⇒ Object
116 117 118 |
# File 'lib/tfl/Flow.rb', line 116 def orphanDataSources @orphanDataSources ||= identifyOrphandatasoUrceS end |
#parameters ⇒ Object
112 113 114 |
# File 'lib/tfl/Flow.rb', line 112 def parameters @parameters ||= loadParameters end |
#release ⇒ Object
72 73 74 |
# File 'lib/tfl/Flow.rb', line 72 def release @build ||= loadBuild end |
#storyboard(name) ⇒ Object
128 129 130 |
# File 'lib/tfl/Flow.rb', line 128 def storyboard name @storyboards[name] end |
#storyboardNames ⇒ Object
124 125 126 |
# File 'lib/tfl/Flow.rb', line 124 def storyboardNames @storyboards.keys end |
#storyboards ⇒ Object
120 121 122 |
# File 'lib/tfl/Flow.rb', line 120 def storyboards @storyboards.values end |
#worksheet(name) ⇒ Object
80 81 82 |
# File 'lib/tfl/Flow.rb', line 80 def worksheet name @worksheets[name] end |
#worksheetNames ⇒ Object
84 85 86 |
# File 'lib/tfl/Flow.rb', line 84 def worksheetNames @worksheets.keys end |
#worksheets ⇒ Object
76 77 78 |
# File 'lib/tfl/Flow.rb', line 76 def worksheets @worksheets.values end |