No commit activity in last 3 years
No release in over 3 years
Create new class inherited from a class you wish to replace and the ability to revert.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

Subclass and Replace

Create a new class which inherits from a class it will replace.

Description

Use this class when you need to replace a class method and still call the superclass method.

Documentation

Install

gem install subclass_and_replace

Example

Set defaults to Rails cookies without writing custom methods or changing core code.

subclass_and_replace ActionDispatch::Cookies::CookieJar do

  def handle_options(options)
    options[:httponly] = true if options[:httponly].nil?
  end

end