Module: ExistDB::ClassWrappingForwardable

Included in:
Collection, Resource::Base, ResourceSet, XQueryService
Defined in:
lib/existdb/classwrap.rb

Instance Method Summary collapse

Instance Method Details

#delegate_to_java(*opts) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/existdb/classwrap.rb', line 50

def delegate_to_java(*opts)
    opts.each do |opt|
        if opt.is_a?(Hash) then
            opt.each do |to, from|
                module_eval "
                    def #{to}(*opts)
                        ClassWrap[ @obj.#{from}( *ClassUnwrap[ opts ] ) ]
                    end
                "
            end
        else
            module_eval "
                def #{opt}(*opts)
                    ClassWrap[ @obj.#{opt}( *ClassUnwrap[ opts ] ) ]
                end
            "
        end
    end
end