Skip to content

prepends modules in front of a class; so method lookup starts with the module

Notifications You must be signed in to change notification settings

banister/prepend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prepend

(c) John Mair (banisterfiend), Asher (Asher) MIT license

Enables modules to be prepended to classes (or other modules).

** This is BETA software and has not yet been thoroughly tested, use at own risk **

install the gem: for testing purposes only gem install prepend

example:

module M
    def hello
        puts "hello!"
    end
end

class A
    def hello
        puts "I feel only hate and loathing"
    end
    prepend M
end

# invoke class method
A.new.hello #=> hello!

About

prepends modules in front of a class; so method lookup starts with the module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages