Quantcast
Channel: Pragmatic Forums | Posts by Bharat Ruparel
Viewing all articles
Browse latest Browse all 25

Episode 3 - my_attr_accessor exercise posted by Bharat Ruparel @ Wed, 25 Jun 2008 16:50:52 +0000

$
0
0

It seems like the code does not contain a solution to this exercise. I am taking the liberty of posting the snippet of solution as I understood your question for the purpose of verification:

define_method("#{name}=") do |val|
  STDERR.puts "var name = #{ivar_name} and value = #{val}" 
  instance_variable_set(ivar_name,val)
end

Is that what you meant?

Bharat


Viewing all articles
Browse latest Browse all 25

Trending Articles