Class: DL::CompositeHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/dl/import.rb

Instance Method Summary collapse

Constructor Details

#initialize(handlers) ⇒ CompositeHandler

Returns a new instance of CompositeHandler.



8
9
10
# File 'lib/dl/import.rb', line 8

def initialize(handlers)
  @handlers = handlers
end

Instance Method Details

#[](symbol) ⇒ Object



29
30
31
# File 'lib/dl/import.rb', line 29

def [](symbol)
  sym(symbol)
end

#handlersObject



12
13
14
# File 'lib/dl/import.rb', line 12

def handlers()
  @handlers
end

#sym(symbol) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dl/import.rb', line 16

def sym(symbol)
  @handlers.each{|handle|
    if( handle )
      begin
        addr = handle.sym(symbol)
        return addr
      rescue DLError
      end
    end
  }
  return nil
end