Enumeración de Coordenadas

09:37][~/Dropbox/src/ruby/rubytesting/TheRubyProgrammingLanguage/Chapter7ClassesAndModules/point]$ export RUBYLIB=$RUBYLIB:.
[09:38][~/Dropbox/src/ruby/rubytesting/TheRubyProgrammingLanguage/Chapter7ClassesAndModules/point]$ echo $RUBYLIB
:.

[09:39][~/Dropbox/src/ruby/rubytesting/TheRubyProgrammingLanguage/Chapter7ClassesAndModules/point]$ irb
ruby-1.9.2-p290 :001 > require 'point' 
 => true 
ruby-1.9.2-p290 :002 > class Point
ruby-1.9.2-p290 :003?>   def each
ruby-1.9.2-p290 :004?>     yield @x
ruby-1.9.2-p290 :005?>     yield @y
ruby-1.9.2-p290 :006?>     end
ruby-1.9.2-p290 :007?>   end
 => nil 
ruby-1.9.2-p290 :008 > p = Point.new(2,1)
 => (2,1) 
ruby-1.9.2-p290 :009 > p.each do |x| puts "coord = #{x}" end
coord = 2
coord = 1
 => nil



Casiano Rodriguez León 2015-06-18