Class: Twb::LocalField
Overview
Assumption: A field can only be either a MetadataField or a LocalField, not both in a given Workbook data connection.
Instance Attribute Summary collapse
-
#datatype ⇒ Object
readonly
Returns the value of attribute datatype.
-
#hidden ⇒ Object
readonly
Returns the value of attribute hidden.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#ordinal ⇒ Object
readonly
Returns the value of attribute ordinal.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#uiname ⇒ Object
readonly
Returns the value of attribute uiname.
Attributes inherited from TabClass
#ttlogfile, #ttlogfilename, #uuid
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(fieldNode) ⇒ LocalField
constructor
A new instance of LocalField.
- #loadProperties ⇒ Object
Methods inherited from TabClass
#docFile, #emit, #setDocFileName
Constructor Details
#initialize(fieldNode) ⇒ LocalField
Returns a new instance of LocalField.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# 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 |
Instance Attribute Details
#datatype ⇒ Object (readonly)
Returns the value of attribute datatype.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def datatype @datatype end |
#hidden ⇒ Object (readonly)
Returns the value of attribute hidden.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def hidden @hidden end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def name @name end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def node @node end |
#ordinal ⇒ Object (readonly)
Returns the value of attribute ordinal.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def ordinal @ordinal end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def properties @properties end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def type @type end |
#uiname ⇒ Object (readonly)
Returns the value of attribute uiname.
24 25 26 |
# File 'lib/twb/localfield.rb', line 24 def uiname @uiname end |
Instance Method Details
#id ⇒ Object
47 48 49 |
# File 'lib/twb/localfield.rb', line 47 def id @id ||= @id = @name.hash end |
#loadProperties ⇒ Object
55 56 57 58 59 60 61 62 |
# 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 |