Method: Library::Domain#acquire

Defined in:
lib/library/domain.rb

#acquire(pathname, options = {}) ⇒ true, false

Roll-style loading. First it looks for a specific library via ‘:`. If `:` is not present it then tries the current loading library. Failing that it fallsback to Ruby itself.

require('facets:string/margin')

To “load” the library, rather than “require” it, set the :load option to true.

require('facets:string/margin', :load=>true)

Parameters:

  • pathname (String)

    pathname of feature relative to library’s loadpath

Returns:

  • (true, false)

    if feature was newly required



214
215
216
217
218
# File 'lib/library/domain.rb', line 214

def acquire(pathname, options={}) #, &block)
  #options.merge!(block.call) if block
  options[:local] = true
  require(pathname, options)
end