Class: Dpm

Inherits:
Object
  • Object
show all
Defined in:
lib/xmlutils/gdlcontextobjs.rb

Overview

class Dpm

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#aliasObject

Returns the value of attribute alias.



18
19
20
# File 'lib/xmlutils/gdlcontextobjs.rb', line 18

def alias
  @alias
end

#dataTypeObject

Returns the value of attribute dataType.



20
21
22
# File 'lib/xmlutils/gdlcontextobjs.rb', line 20

def dataType
  @dataType
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'lib/xmlutils/gdlcontextobjs.rb', line 17

def name
  @name
end

#prodTypeObject

Returns the value of attribute prodType.



21
22
23
# File 'lib/xmlutils/gdlcontextobjs.rb', line 21

def prodType
  @prodType
end

#varTypeObject

Returns the value of attribute varType.



19
20
21
# File 'lib/xmlutils/gdlcontextobjs.rb', line 19

def varType
  @varType
end