Method: Library.instance

Defined in:
lib/library.rb

.instance(name, constraint = nil) ⇒ Library, NilClass

TODO:

This method might be deprecated.

Get an instance of a library by name, or name and version. Libraries are singleton, so once loaded the same object is always returned.

Returns:

  • (Library, NilClass)

    The activated Library instance, or ‘nil` if not found.



64
65
66
# File 'lib/library.rb', line 64

def self.instance(name, constraint=nil)
  $LEDGER.activate(name, constraint) if $LEDGER.key?(name)
end