search for: initialize_with_extension

Displaying 1 result from an estimated 1 matches for "initialize_with_extension".

2008 Nov 23
4
Strange behavior of alias_method_chains
...ttr_accessor :value def initialize (a, b) puts "in XYZ constructor" self.name = a self.value = b end def a puts self.name end def b puts self.value end end </code> , and an extended class XYZ in app/views/xyz_ext.rb <code> class XYZ def initialize_with_extension a,b puts "before chain" initialize_without_extension a,b puts "after chain" end alias_method_chain :initialize, :extension end </code> So basically what I expect to have three lines in the console when creating XYZ: 1) before chain 2) in Alias cons...