Displaying 1 result from an estimated 1 matches for "xyz_ext".
Did you mean:
xyz_dat
2008 Nov 23
4
Strange behavior of alias_method_chains
...e>
class XYZ
attr_accessor :name
attr_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...