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

View differences:

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

  
19 19
module OpenNebula
20 20

  
21
    # All subclasses must define the DocumentPool::TYPE constant
21
    # All subclasses must define the DOCUMENT_TYPE constant
22 22
    # and the factory method.
23 23
    #
24 24
    # @example
......
27 27
    #   module OpenNebula
28 28
    #       class CustomObjectPool < DocumentPool
29 29
    #
30
    #           DocumentPool::TYPE = 400
30
    #           DOCUMENT_TYPE = 400
31 31
    #
32 32
    #           def factory(element_xml)
33 33
    #               OpenNebula::CustomObject.new(element_xml, @client)
......
72 72
        def info(*args)
73 73
            case args.size
74 74
                when 0
75
                    info_filter(DOCUMENT_POOL_METHODS[:info],@user_id,-1,-1, TYPE)
75
                    info_filter(DOCUMENT_POOL_METHODS[:info],@user_id,-1,-1, document_type)
76 76
                when 3
77
                    info_filter(DOCUMENT_POOL_METHODS[:info],args[0],args[1],args[2], TYPE)
77
                    info_filter(DOCUMENT_POOL_METHODS[:info],args[0],args[1],args[2], document_type)
78 78
            end
79 79
        end
80 80

  
81 81
        def info_all()
82
            return super(DOCUMENT_POOL_METHODS[:info], TYPE)
82
            return super(DOCUMENT_POOL_METHODS[:info], document_type)
83 83
        end
84 84

  
85 85
        def info_mine()
86
            return super(DOCUMENT_POOL_METHODS[:info], TYPE)
86
            return super(DOCUMENT_POOL_METHODS[:info], document_type)
87 87
        end
88 88

  
89 89
        def info_group()
90
            return super(DOCUMENT_POOL_METHODS[:info], TYPE)
90
            return super(DOCUMENT_POOL_METHODS[:info], document_type)
91
        end
92

  
93
        def document_type
94
            self.class::DOCUMENT_TYPE
91 95
        end
92 96
    end
93 97
end

Also available in: Unified diff