Skip to content

mynyml/override

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

=== Summary

  Allows using the 'super' keyword with methods previously defined in reopened classes.
  Simple and elegant alternative to Rails' #alias_method_chain for redefining methods while keeping access to the previous definition.

=== Install

  gem install mynyml-override --source http://gemcutter.org

=== Examples

  require 'override'

  class Post
    def text
      @text.strip
    end
  end

  class Post
    override :text
    def text
      super.reverse
    end
  end

About

Like #alias_method_chain, but awesome

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages