Revision 4363e23a src/oca/ruby/OpenNebula/Document.rb

View differences:

src/oca/ruby/OpenNebula/Document.rb
18 18

  
19 19
module OpenNebula
20 20

  
21
    # All subclasses must define the Document::TYPE constant.
21
    # All subclasses must define the DOCUMENT_TYPE constant.
22 22
    #
23 23
    # @example
24 24
    #   require 'OpenNebula/Document'
25 25
    #
26 26
    #   module OpenNebula
27 27
    #       class CustomObject < Document
28
    #   
29
    #           Document::TYPE = 400
28
    #
29
    #           DOCUMENT_TYPE = 400
30 30
    #
31 31
    #       end
32 32
    #   end
......
65 65
        #
66 66
        # @param [Nokogiri::XML::Node, REXML::Element] xml string
67 67
        #   created by the build_xml() method
68
        # @param [OpenNebula::Client] client the xml-rpc client 
68
        # @param [OpenNebula::Client] client the xml-rpc client
69 69
        #
70 70
        # @return [Document] the new object
71 71
        #
......
94 94
        # @return [nil, OpenNebula::Error] nil in case of success, Error
95 95
        #   otherwise
96 96
        def allocate(description)
97
            super(DOCUMENT_METHODS[:allocate], description, TYPE)
97
            super(DOCUMENT_METHODS[:allocate], description, document_type)
98 98
        end
99 99

  
100 100
        # Deletes the Document
......
187 187
            end
188 188
        end
189 189

  
190
        def document_type
191
            self.class::DOCUMENT_TYPE
192
        end
193

  
190 194
    private
191 195

  
192 196
        def set_publish(published)

Also available in: Unified diff