ActiveSupportAliasClassMethod
A supplementary library of activesupport to provide alias_class_method
and alias_class_method_chain
.
Installation
Add this line to your application's Gemfile:
gem 'active_support_alias_class_method'
And then execute:
$ bundle
Or install it yourself as:
$ gem install active_support_alias_class_method
Usage
require 'active_support_alias_class_method/core_ext/module'
class Foo
def self.foo
:foo
end
alias_class_method :bar, :foo
end
Foo.foo #=> :foo
Foo. #=> :foo
class Foo
def self.foo_with_baz
[:baz, foo_without_baz]
end
alias_class_method_chain :foo, :baz
end
Foo.foo #=> [:baz, :foo]
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request