Class: Twb::ColumnField

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/twb/columnfield.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fieldNode) ⇒ ColumnField

Returns a new instance of ColumnField.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/twb/columnfield.rb', line 58

def initialize fieldNode
  @node               = fieldNode
  @name               = load 'name'
  @caption            = load 'caption'
  @uiname             = @caption.nil? ? @name : @caption
  @dataType           = load 'datatype'
  @userDataType       = load 'user-datatype'
  @defaultFormat      = load 'default-format'
  @paramDomainType    = load 'param-domain-type'
  @role               = load 'role'
  @type               = load 'type'
  @value              = load 'value'
  @alias              = load 'alias'
  @semanticRole       = load 'semantic-role'
  @aggregation        = load 'aggregation'
  @autoColumn         = load 'auto-column'
  @hidden             = load 'hidden'
  @datatypeCustomized = load 'datatype-customized'
end

Instance Attribute Details

#aggregationObject (readonly)

Returns the value of attribute aggregation.



54
55
56
# File 'lib/twb/columnfield.rb', line 54

def aggregation
  @aggregation
end

#aliasObject (readonly)

Returns the value of attribute alias.



54
55
56
# File 'lib/twb/columnfield.rb', line 54

def alias
  @alias
end

#autoColumnObject (readonly)

Returns the value of attribute autoColumn.



55
56
57
# File 'lib/twb/columnfield.rb', line 55

def autoColumn
  @autoColumn
end

#captionObject (readonly)

Returns the value of attribute caption.



51
52
53
# File 'lib/twb/columnfield.rb', line 51

def caption
  @caption
end

#dataTypeObject (readonly)

Returns the value of attribute dataType.



52
53
54
# File 'lib/twb/columnfield.rb', line 52

def dataType
  @dataType
end

#datatypeCustomizedObject (readonly)

Returns the value of attribute datatypeCustomized.



55
56
57
# File 'lib/twb/columnfield.rb', line 55

def datatypeCustomized
  @datatypeCustomized
end

#defaultFormatObject (readonly)

Returns the value of attribute defaultFormat.



52
53
54
# File 'lib/twb/columnfield.rb', line 52

def defaultFormat
  @defaultFormat
end

#hiddenObject (readonly)

Returns the value of attribute hidden.



55
56
57
# File 'lib/twb/columnfield.rb', line 55

def hidden
  @hidden
end

#nameObject (readonly)

Returns the value of attribute name.



51
52
53
# File 'lib/twb/columnfield.rb', line 51

def name
  @name
end

#nodeObject (readonly)

XML Attributes known to exist in TWB xml


aggregation aggregation-param alias auto-column caption datatype datatype-customized default-format default-role default-type hidden layered name param-domain-type pivot role semantic-role SplitFieldIndex SplitFieldOrigin type user-datatype value visual-totals



50
51
52
# File 'lib/twb/columnfield.rb', line 50

def node
  @node
end

#paramDomainTypeObject (readonly)

Returns the value of attribute paramDomainType.



52
53
54
# File 'lib/twb/columnfield.rb', line 52

def paramDomainType
  @paramDomainType
end

#roleObject (readonly)

Returns the value of attribute role.



53
54
55
# File 'lib/twb/columnfield.rb', line 53

def role
  @role
end

#semanticRoleObject (readonly)

Returns the value of attribute semanticRole.



54
55
56
# File 'lib/twb/columnfield.rb', line 54

def semanticRole
  @semanticRole
end

#typeObject (readonly)

Returns the value of attribute type.



53
54
55
# File 'lib/twb/columnfield.rb', line 53

def type
  @type
end

#uinameObject (readonly)

Returns the value of attribute uiname.



51
52
53
# File 'lib/twb/columnfield.rb', line 51

def uiname
  @uiname
end

#valueObject (readonly)

Returns the value of attribute value.



53
54
55
# File 'lib/twb/columnfield.rb', line 53

def value
  @value
end

Instance Method Details

#<=>(other) ⇒ Object



88
89
90
# File 'lib/twb/columnfield.rb', line 88

def <=>(other)
  @name <=> other.name
end

#load(nodeName) ⇒ Object



78
79
80
81
82
# File 'lib/twb/columnfield.rb', line 78

def load nodeName
  attr = @node.attribute(nodeName)
  val  = attr.nil? ? nil : attr.text.strip.gsub(/^\[|\]$/,'')
  return val
end

#to_sObject



84
85
86
# File 'lib/twb/columnfield.rb', line 84

def to_s
  @name
end