Class: Fiddle::CompositeHandler
- Inherits:
-
Object
- Object
- Fiddle::CompositeHandler
- Defined in:
- lib/fiddle/import.rb
Overview
Used internally by Fiddle::Importer
Instance Method Summary collapse
-
#[](symbol) ⇒ Object
See Fiddle::CompositeHandler.sym.
-
#handlers ⇒ Object
Array of the currently loaded libraries.
-
#initialize(handlers) ⇒ CompositeHandler
constructor
Create a new handler with the open
handlers
. -
#sym(symbol) ⇒ Object
Returns the address as an Integer from any handlers with the function named
symbol
.
Constructor Details
#initialize(handlers) ⇒ CompositeHandler
Create a new handler with the open handlers
Used internally by Fiddle::Importer.dlload
12 13 14 |
# File 'lib/fiddle/import.rb', line 12 def initialize(handlers) @handlers = handlers end |
Instance Method Details
#[](symbol) ⇒ Object
See Fiddle::CompositeHandler.sym
39 40 41 |
# File 'lib/fiddle/import.rb', line 39 def [](symbol) sym(symbol) end |
#handlers ⇒ Object
Array of the currently loaded libraries.
17 18 19 |
# File 'lib/fiddle/import.rb', line 17 def handlers() @handlers end |
#sym(symbol) ⇒ Object
Returns the address as an Integer from any handlers with the function named symbol
.
Raises a DLError if the handle is closed.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fiddle/import.rb', line 25 def sym(symbol) @handlers.each{|handle| if( handle ) begin addr = handle.sym(symbol) return addr rescue DLError end end } return nil end |