Module | Facade |
In: |
lib/facade.rb
|
FACADE_VERSION | = | '1.0.4' | The version of the facade library |
The facade method will forward a singleton method as an instance method of the extending class. If no arguments are provided, then all singleton methods of the class or module become instance methods.
Existing instance methods are NOT overridden, but are instead ignored.
Example:
require 'facade' class MyString < String extend Facade facade File, :dirname, :basename end s = MyString.new('/home/djberge') s.basename # => 'djberge' s.dirname # => '/home'