In the last month I had to write a lot of Java and I found that
interesting concept of fluent interfaces, where instead if writing a big
constructor, you have expressive getters and setters for every attribute. I
wrote a post about how to implement such a fluent interface in Ruby
http://blog.timkaechele.me/2015/07/12/fluent-interfaces-in-ruby.html
But now I wonder if fluent interfaces are really a thing in Ruby, because
of all the syntactic sugar the language already provides. What do you think?
At least for your Point I would simply use a Struct:
$ ./x.rb
#<struct Point x=1, y=2>
#<struct Point x=1, y=2>
#<struct Point x=1, y=2>
$ cat x.rb
#!/usr/bin/ruby
Point = Struct.new :x, :y
def Point(x, y = Point)
if y.equal? Point
Point.new(*Point.members.map {|m| x[m]})
else
Point.new(x, y)
end
end
p Point[1,2]
p Point(1, 2)
p Point(x: 1, y: 2)
For me that is expressive enough. Even without defining Point() what the
Struct generated class provides is pretty good (the first one with the
square brackets).
I hope it is appropriate to ask this question in this mailing list. I am
pretty new to all those mailing lists and this is my first contribution.
That is totally appropriate. Actually, I find these types of posts are the
more interesting ones so please keep them coming! 
Kind regards
robert
···
On Tue, Jul 14, 2015 at 9:21 AM, Tim Kächele <mail@timkaechele.me> wrote:
--
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can -
without end}
http://blog.rubybestpractices.com/