Sha256: 412e481cf1a0c5058ee4e6b689b41e6fe509e749cee51151ce3567252f8c9556
Contents?: true
Size: 469 Bytes
Versions: 2
Compression:
Stored size: 469 Bytes
Contents
class Module def alias_method_chain(target, feature) # Strip out punctuation on predicates or bang methods since # e.g. target?_without_feature is not a valid method name. aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1 yield(aliased_target, punctuation) if block_given? alias_method "#{aliased_target}_without_#{feature}#{punctuation}", target alias_method target, "#{aliased_target}_with_#{feature}#{punctuation}" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
merb-0.0.8 | lib/merb/core_ext/merb_module.rb |
merb-0.0.9 | lib/merb/core_ext/merb_module.rb |