# (1..5).step(SimpleDelegator.new(Rational(3,2))) {|x| p x }

**URL:** <https://www.ruby-forum.com/t/1-5-step-simpledelegator-new-rational-3-2-x-p-x/138395>\
**Category:** Development\
**Created:** [May 22, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/1-5-step-simpledelegator-new-rational-3-2-x-p-x/138395 "2008-05-22T16:06:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [May 22, 2008, 4:06pm UTC](https://www.ruby-forum.com/t/1-5-step-simpledelegator-new-rational-3-2-x-p-x/138395/1 "2008-05-22T16:06:30Z")

</div>

Range#step e$B$G!"0z?t$Ke(B Rational(3,2) e$B$rM?$($?\>l9g$He(B  
SimpleDelegator.new(Rational(3,2)) e$B$rM?$($?\>l9g$G7k2L$,0J2\<e(B  
e$B$N$h$&$K0[$J$k$N$OJQ$G$O$J$$$G$7$g$&$+!#e(B

% ./ruby -v -rdelegate -e  
‘(1…5).step(SimpleDelegator.new(Rational(3,2))) {|x| p x }’  
ruby 1.9.0 (2008-05-22 revision 16533) [i686-linux]  
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/delegate.rb:225: warning: instance  
variable @delegate\_sd\_obj not initialized  
1  
2  
3  
4  
5

% ./ruby -ve ‘(1…5).step(Rational(3,2)) {|x| p x }’  
ruby 1.9.0 (2008-05-22 revision 16533) [i686-linux]  
1  
Rational(5, 2)  
Rational(4, 1)
