class Twb::LocalField
Assumption: A field can only be either a MetadataField
or a LocalField
, not both in a given Workbook
data connection.
Attributes
datatype[R]
name[R]
node[R]
ordinal[R]
properties[R]
type[R]
uiname[R]
Public Class Methods
new(fieldNode)
click to toggle source
# File lib/twb/localfield.rb, line 26 def initialize fieldNode @node = fieldNode @type = 'local' @datatype = @node.attr('datatype') @name = @node.attr('name') @uiname = @name @ordinal = @node.attr('ordinal') # @properties = @node.attributes # @dbname = @node.attr('name').gsub(/^\[/,'').gsub(/\]$/,'') # @datatype = @node.attr('datatype') # @role = @node.attr('role') # @type = @node.attr('type') @hidden = @node.attr('hidden') # @caption = @node.attr('caption') # @aggregation = @node.attr('aggregation') # @calculation = getCalculation # @comments = getComments # @uiname = if @caption.nil? || @caption == '' then @dbname else @caption end # return self end
Public Instance Methods
id()
click to toggle source
# File lib/twb/localfield.rb, line 47 def id @id ||= @id = @name.hash end
loadProperties()
click to toggle source
# File lib/twb/localfield.rb, line 55 def loadProperties @properties= {} @node.attributes.each do |name,attr| @properties[name] = attr.value end @properties[:uiname] = @name return @properties end