Class: Twb::ReferencedField
- Inherits:
-
Object
- Object
- Twb::ReferencedField
- Includes:
- Comparable, TabTool
- Defined in:
- lib/twb/fieldcalculation.rb
Overview
class CalculationField
Instance Attribute Summary collapse
-
#dataSource ⇒ Object
readonly
Returns the value of attribute dataSource.
-
#dataSourceExists ⇒ Object
readonly
Returns the value of attribute dataSourceExists.
-
#dataSourceName ⇒ Object
readonly
Returns the value of attribute dataSourceName.
-
#dataSourceRef ⇒ Object
readonly
Returns the value of attribute dataSourceRef.
-
#fqName ⇒ Object
readonly
Returns the value of attribute fqName.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#techCode ⇒ Object
readonly
Returns the value of attribute techCode.
-
#techUIdiff ⇒ Object
readonly
Returns the value of attribute techUIdiff.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#uiCode ⇒ Object
readonly
Returns the value of attribute uiCode.
-
#uiname ⇒ Object
readonly
Returns the value of attribute uiname.
Attributes included from TabTool
#alerts, #docDir, #docfiles, #funcdoc, #licensed, #logfilename, #logger, #loglevel, #metrics, #properties, #ttdocdir, #uuid
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#id ⇒ Object
initialize.
-
#initialize(name, datasource) ⇒ ReferencedField
constructor
A new instance of ReferencedField.
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(name, datasource) ⇒ ReferencedField
Returns a new instance of ReferencedField.
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/twb/fieldcalculation.rb', line 344 def initialize name, datasource # puts "\n\nReferencedField :: ds: %-25s | n: %s " % [datasource, name] @name = name @dataSource = datasource @dataSourceName = datasource.nil? ? nil : datasource.uiname @dataSourceRef = :local @dataSourceExists = true @techCode = "[#{name}]" @techUIdiff = false if dataSource.nil? # puts 'a' @uiname = @name @uiCode = @techCode @techUIdiff = false else # !datasource.nil? # puts 'b' # puts "b - found uiname for '#{@name}'?: #{!datasource.fieldUIName(@name).nil?} \t is:#{datasource.fieldUIName(@name)} " @uiname = datasource.fieldUIName(@name).nil? ? @name : datasource.fieldUIName(@name) @uiCode = @uiname.nil? ? @techCode : "[#{@uiname}]" @techUIdiff = !@techCode.eql?(@uiCode) # puts ":b #{datasource.fieldUIName(@name).nil?} ... #{@name} ... #{@uiname}" # puts "CalculationField :: uin: %-25s | @name:%-s" % [@uiname,@name] end @fqName = "#{@dataSourceName}::#{@uiname}" @type = if @dataSource.nil? :CalculatedField else @dataSource.calculatedField(@uiname).nil? ? :DatabaseField : :CalculatedField end end |
Instance Attribute Details
#dataSource ⇒ Object (readonly)
Returns the value of attribute dataSource.
340 341 342 |
# File 'lib/twb/fieldcalculation.rb', line 340 def dataSource @dataSource end |
#dataSourceExists ⇒ Object (readonly)
Returns the value of attribute dataSourceExists.
340 341 342 |
# File 'lib/twb/fieldcalculation.rb', line 340 def dataSourceExists @dataSourceExists end |
#dataSourceName ⇒ Object (readonly)
Returns the value of attribute dataSourceName.
340 341 342 |
# File 'lib/twb/fieldcalculation.rb', line 340 def dataSourceName @dataSourceName end |
#dataSourceRef ⇒ Object (readonly)
Returns the value of attribute dataSourceRef.
340 341 342 |
# File 'lib/twb/fieldcalculation.rb', line 340 def dataSourceRef @dataSourceRef end |
#fqName ⇒ Object (readonly)
Returns the value of attribute fqName.
341 342 343 |
# File 'lib/twb/fieldcalculation.rb', line 341 def fqName @fqName end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
338 339 340 |
# File 'lib/twb/fieldcalculation.rb', line 338 def name @name end |
#techCode ⇒ Object (readonly)
Returns the value of attribute techCode.
338 339 340 |
# File 'lib/twb/fieldcalculation.rb', line 338 def techCode @techCode end |
#techUIdiff ⇒ Object (readonly)
Returns the value of attribute techUIdiff.
342 343 344 |
# File 'lib/twb/fieldcalculation.rb', line 342 def techUIdiff @techUIdiff end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
341 342 343 |
# File 'lib/twb/fieldcalculation.rb', line 341 def type @type end |
#uiCode ⇒ Object (readonly)
Returns the value of attribute uiCode.
339 340 341 |
# File 'lib/twb/fieldcalculation.rb', line 339 def uiCode @uiCode end |
#uiname ⇒ Object (readonly)
Returns the value of attribute uiname.
339 340 341 |
# File 'lib/twb/fieldcalculation.rb', line 339 def uiname @uiname end |
Instance Method Details
#<=>(other) ⇒ Object
379 380 381 382 383 384 385 386 |
# File 'lib/twb/fieldcalculation.rb', line 379 def <=>(other) # myName = @uiname.nil? ? '' : @uiname # otherName = other.uiName.nil? ? "" : other.uiName # # puts "#{@uiname} / #{myName} <=> #{otherName} / #{other.uiName}" # # puts "#{@uiname.nil?} // #{other.uiName.nil?}" # myName <=> otherName @fqName <=> other.fqName end |
#id ⇒ Object
initialize
375 376 377 |
# File 'lib/twb/fieldcalculation.rb', line 375 def id @id ||= @id = "#{@dataSourceName}::#{@uiname}" end |