W3cubDocs

/Ruby 2.4

class Fiddle::CompositeHandler

Parent:
Object

Used internally by Fiddle::Importer

Public Class Methods

new(handlers) Show source

Create a new handler with the open handlers

Used internally by Fiddle::Importer#dlload

# File ext/fiddle/lib/fiddle/import.rb, line 12
def initialize(handlers)
  @handlers = handlers
end

Public Instance Methods

[](symbol) Show source

See #sym

# File ext/fiddle/lib/fiddle/import.rb, line 39
def [](symbol)
  sym(symbol)
end
handlers() Show source

Array of the currently loaded libraries.

# File ext/fiddle/lib/fiddle/import.rb, line 17
def handlers()
  @handlers
end
sym(symbol) Show source

Returns the address as an Integer from any handlers with the function named symbol.

Raises a DLError if the handle is closed.

# File ext/fiddle/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

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.