Class: Twb::Parameter

Inherits:
Object
  • Object
show all
Includes:
TabTool
Defined in:
lib/twb/parameter.rb

Instance Attribute Summary collapse

Attributes included from TabTool

#alerts, #docDir, #docfiles, #funcdoc, #id, #licensed, #logfilename, #logger, #loglevel, #metrics, #properties, #ttdocdir, #uuid

Instance Method Summary collapse

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(paramNode) ⇒ Parameter

Returns a new instance of Parameter.


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/twb/parameter.rb', line 31

def initialize(paramNode)
    @node       = paramNode
    # -- 
    @name           = @node['name'].gsub(/^\[|\]$/,'')
    @caption        = @node['caption']
    @uiname         = caption.nil? ? nameTech : caption
    @dataType       = @node['datatype']
    @format         = @node['default-format'].nil?      ? '<<default>>' : @node['default-format']
    @dataTypeCustom = @node['datatype-customized'].nil? ? false : true
    @domainType     = @node['param-domain-type']
    @role           = @node['role']
    @type           = @node['type']
    @currentValue   = paramNode.at_xpath('./calculation[@class="tableau"]')['formula'].gsub(/^[#"]|[#"]$/,'')
    @values         = []
    processNode
end

Instance Attribute Details

#captionObject (readonly)

Returns the value of attribute caption


25
26
27
# File 'lib/twb/parameter.rb', line 25

def caption
  @caption
end

#currentValueObject (readonly)

Returns the value of attribute currentValue


28
29
30
# File 'lib/twb/parameter.rb', line 28

def currentValue
  @currentValue
end

#dataTypeObject (readonly)

Returns the value of attribute dataType


26
27
28
# File 'lib/twb/parameter.rb', line 26

def dataType
  @dataType
end

#dataTypeCustomObject (readonly)

Returns the value of attribute dataTypeCustom


26
27
28
# File 'lib/twb/parameter.rb', line 26

def dataTypeCustom
  @dataTypeCustom
end

#domainTypeObject (readonly)

Returns the value of attribute domainType


27
28
29
# File 'lib/twb/parameter.rb', line 27

def domainType
  @domainType
end

#formatObject (readonly)

Returns the value of attribute format


26
27
28
# File 'lib/twb/parameter.rb', line 26

def format
  @format
end

#nameObject (readonly)

Returns the value of attribute name


25
26
27
# File 'lib/twb/parameter.rb', line 25

def name
  @name
end

#nodeObject (readonly)

Returns the value of attribute node


29
30
31
# File 'lib/twb/parameter.rb', line 29

def node
  @node
end

#roleObject (readonly)

Returns the value of attribute role


27
28
29
# File 'lib/twb/parameter.rb', line 27

def role
  @role
end

#typeObject (readonly)

Returns the value of attribute type


27
28
29
# File 'lib/twb/parameter.rb', line 27

def type
  @type
end

#uinameObject (readonly)

Returns the value of attribute uiname


25
26
27
# File 'lib/twb/parameter.rb', line 25

def uiname
  @uiname
end

#valuesObject (readonly)

Returns the value of attribute values


28
29
30
# File 'lib/twb/parameter.rb', line 28

def values
  @values
end

Instance Method Details

#to_sObject


48
49
50
# File 'lib/twb/parameter.rb', line 48

def to_s
    "%s => %s" % [uiname, values]
end