Class: Twb::MetadataField
- Inherits:
-
Object
- Object
- Twb::MetadataField
- Defined in:
- lib/twb/metadatafield.rb
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
-
#aggregation ⇒ Object
readonly
Returns the value of attribute aggregation.
-
#containsnull ⇒ Object
readonly
Returns the value of attribute containsnull.
-
#localname ⇒ Object
readonly
Returns the value of attribute localname.
-
#localtype ⇒ Object
readonly
Returns the value of attribute localtype.
-
#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.
-
#parentname ⇒ Object
readonly
Returns the value of attribute parentname.
-
#precision ⇒ Object
readonly
Returns the value of attribute precision.
-
#remotealias ⇒ Object
readonly
Returns the value of attribute remotealias.
-
#remotename ⇒ Object
readonly
Returns the value of attribute remotename.
-
#remotetype ⇒ Object
readonly
Returns the value of attribute remotetype.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(fieldNode) ⇒ MetadataField
constructor
A new instance of MetadataField.
- #load(nodeName) ⇒ Object
Constructor Details
#initialize(fieldNode) ⇒ MetadataField
Returns a new instance of MetadataField.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/twb/metadatafield.rb', line 26 def initialize fieldNode @node = fieldNode @aggregation = load 'aggregation' @containsnull = load 'contains-null' @localname = load 'local-name' @localtype = load 'local-type' @ordinal = load 'ordinal' @parentname = load 'parent-name' @precision = load 'precision' @remotealias = load 'remote-alias' @remotename = load 'remote-name' @name = @remotename @remotetype = load 'remote-type' @width = load 'width' return self end |
Instance Attribute Details
#aggregation ⇒ Object (readonly)
Returns the value of attribute aggregation.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def aggregation @aggregation end |
#containsnull ⇒ Object (readonly)
Returns the value of attribute containsnull.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def containsnull @containsnull end |
#localname ⇒ Object (readonly)
Returns the value of attribute localname.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def localname @localname end |
#localtype ⇒ Object (readonly)
Returns the value of attribute localtype.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def localtype @localtype end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def name @name end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def node @node end |
#ordinal ⇒ Object (readonly)
Returns the value of attribute ordinal.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def ordinal @ordinal end |
#parentname ⇒ Object (readonly)
Returns the value of attribute parentname.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def parentname @parentname end |
#precision ⇒ Object (readonly)
Returns the value of attribute precision.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def precision @precision end |
#remotealias ⇒ Object (readonly)
Returns the value of attribute remotealias.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def remotealias @remotealias end |
#remotename ⇒ Object (readonly)
Returns the value of attribute remotename.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def remotename @remotename end |
#remotetype ⇒ Object (readonly)
Returns the value of attribute remotetype.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def remotetype @remotetype end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
24 25 26 |
# File 'lib/twb/metadatafield.rb', line 24 def width @width end |
Instance Method Details
#load(nodeName) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/twb/metadatafield.rb', line 43 def load nodeName node = @node.at_xpath(nodeName) val = if node.nil? then node else node.text end # puts "==== MD node:'#{nodeName}' \t nil?'#{node.nil?}' \t == val:#{val} \t = '#{node}' " return val end |