vadviktor
7/16/2014 - 1:27 PM

alias_method_chain example

alias_method_chain example

require 'active_support/core_ext/module/aliasing'
require 'pry'

class A

	def hello
		puts 'hello'
	end

	def hello_with_as_string # new hello
		hello_without_as_string # old hello
		puts 'master'
	end

	alias_method_chain :hello, :as_string

end

a = A.new

binding.pry