On 19/06/2006, at 4:56 PM, O Plameras wrote:
#!/usr/bin/env ruby
class RubyLesson
[..]
I'm not a ruby programmer, but can I ask why you'd make this part
of a
class? Surely a function roundNumbers(x) would work just as well? The
whole class infrastructure seems rather redundant and makes what
should be simple code overly verbose.
It's part of an effort to discipline my programming-mental-attitude
to think object-oriented.
So, eventually, it becomes natural and conforming with the concept
that Ruby is pure
object-oriented.
Does Ruby permit you to add new methods to a existing classes?
(Sorry, I know SFA about Ruby.) If it does, arguably the best place
for this function would be in a number/integer class...
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
_______________________________________________
coders mailing list
coders@slug.org.au
http://lists.slug.org.au/listinfo/coders