Class: Dpm
- Inherits:
-
Object
- Object
- Dpm
- Defined in:
- lib/xmlutils/gdlcontextobjs.rb
Overview
class Dpm
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#dataType ⇒ Object
Returns the value of attribute dataType.
-
#name ⇒ Object
Returns the value of attribute name.
-
#prodType ⇒ Object
Returns the value of attribute prodType.
-
#varType ⇒ Object
Returns the value of attribute varType.
Instance Method Summary collapse
-
#initialize(name, attributes) ⇒ Dpm
constructor
A new instance of Dpm.
Constructor Details
#initialize(name, attributes) ⇒ Dpm
Returns a new instance of Dpm.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/xmlutils/gdlcontextobjs.rb', line 23 def initialize(name, attributes) @name = name @alias = attributes["Name"] @varType = attributes["Type"] @dataType = attributes["DataType"] if attributes.has_key?("DataType") @prodType = attributes["ProductType"] @dataType = @prodType if (nil == @dataType) case @prodType when '1' @prodType = "boolean" when '2' @prodType = "date" when '3' @prodType = "money" when '4' @prodType = "numeric" when '5' @prodType = "percentage" when '6' @prodType = "text" end # prodType end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
18 19 20 |
# File 'lib/xmlutils/gdlcontextobjs.rb', line 18 def alias @alias end |
#dataType ⇒ Object
Returns the value of attribute dataType.
20 21 22 |
# File 'lib/xmlutils/gdlcontextobjs.rb', line 20 def dataType @dataType end |
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/xmlutils/gdlcontextobjs.rb', line 17 def name @name end |
#prodType ⇒ Object
Returns the value of attribute prodType.
21 22 23 |
# File 'lib/xmlutils/gdlcontextobjs.rb', line 21 def prodType @prodType end |
#varType ⇒ Object
Returns the value of attribute varType.
19 20 21 |
# File 'lib/xmlutils/gdlcontextobjs.rb', line 19 def varType @varType end |