Class Boson::ModuleLibrary

  1. lib/boson/libraries/module_library.rb
Parent: Boson::Library

This library takes a module or class as a library’s name and loads its class methods as commands. If no commands are given it defaults to loading all of its class methods as commands. The only method callback (see Loader) this library calls on the original module/class is config().


>> load_library Math, :commands=>%w{sin cos tan}
=> true

# Let's brush up on ol trig
>> sin (Math::PI/2)
=> 1.0
>> tan (Math::PI/4)
=> 1.0
# Close enough :)
>> cos (Math::PI/2)
=> 6.12323399573677e-17