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.
340 341 342 343 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 |
# File 'lib/twb/fieldcalculation.rb', line 340 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.
336 337 338 |
# File 'lib/twb/fieldcalculation.rb', line 336 def dataSource @dataSource end |
#dataSourceExists ⇒ Object (readonly)
Returns the value of attribute dataSourceExists.
336 337 338 |
# File 'lib/twb/fieldcalculation.rb', line 336 def dataSourceExists @dataSourceExists end |
#dataSourceName ⇒ Object (readonly)
Returns the value of attribute dataSourceName.
336 337 338 |
# File 'lib/twb/fieldcalculation.rb', line 336 def dataSourceName @dataSourceName end |
#dataSourceRef ⇒ Object (readonly)
Returns the value of attribute dataSourceRef.
336 337 338 |
# File 'lib/twb/fieldcalculation.rb', line 336 def dataSourceRef @dataSourceRef end |
#fqName ⇒ Object (readonly)
Returns the value of attribute fqName.
337 338 339 |
# File 'lib/twb/fieldcalculation.rb', line 337 def fqName @fqName end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
334 335 336 |
# File 'lib/twb/fieldcalculation.rb', line 334 def name @name end |
#techCode ⇒ Object (readonly)
Returns the value of attribute techCode.
334 335 336 |
# File 'lib/twb/fieldcalculation.rb', line 334 def techCode @techCode end |
#techUIdiff ⇒ Object (readonly)
Returns the value of attribute techUIdiff.
338 339 340 |
# File 'lib/twb/fieldcalculation.rb', line 338 def techUIdiff @techUIdiff end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
337 338 339 |
# File 'lib/twb/fieldcalculation.rb', line 337 def type @type end |
#uiCode ⇒ Object (readonly)
Returns the value of attribute uiCode.
335 336 337 |
# File 'lib/twb/fieldcalculation.rb', line 335 def uiCode @uiCode end |
#uiname ⇒ Object (readonly)
Returns the value of attribute uiname.
335 336 337 |
# File 'lib/twb/fieldcalculation.rb', line 335 def uiname @uiname end |
Instance Method Details
#<=>(other) ⇒ Object
375 376 377 378 379 380 381 382 |
# File 'lib/twb/fieldcalculation.rb', line 375 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
371 372 373 |
# File 'lib/twb/fieldcalculation.rb', line 371 def id @id ||= @id = "#{@dataSourceName}::#{@uiname}" end |