Class: Module

Class | Module
In: | lib/gettext/rails_compat.rb
Parent: | Object

This file is for Rails-1.1.6. From activesupport-1.4.1/lib/active_support/core_ext/module/aliasing.rb

### Methods

alias_method_chain

### Public Instance methods

alias_method_chain(target, feature) {|aliased_target, punctuation| ...}

[Source]

        # File lib/gettext/rails_compat.rb, line 7
     7:     def alias_method_chain(target, feature)
     8:       # Strip out punctuation on predicates or bang methods since
     9:       # e.g. target?_without_feature is not a valid method name.
    10:       aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
    11:       yield(aliased_target, punctuation) if block_given?
    12:       alias_method "#{aliased_target}_without_#{feature}#{punctuation}", target
    13:       alias_method target, "#{aliased_target}_with_#{feature}#{punctuation}"
    14:     end

[Validate]