Skip to content

fronx/reincarnation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reincarnation

monkey patch existing class and modules with the added comfort of "super". in other words: you shouldn't even consider using this.

example for classes:

require 'reincarnation'

class Abc
  def foo
    "foo"
  end
end

Abc.reincarnate

class Abc
  def foo
    puts super
  end
end

Abc.new.foo

example for modules:

require 'reincarnation'

module Boo
  def bar
    "bar"
  end
end

Boo.reincarnate

module Boo
  def bar
    puts super
  end
end

class BooTest
  include Boo
end

BooTest.new.bar

MIT license

About

reincarnation for modules and classes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages