No, I definitely wouldn't trade an overly-complex method signature for an
over-complicated constructor signature. As you say, there's no advantage to
that. 

What I would do is break the complexity up and spread it across a bunch of
methods on a class. 

 -- elliott

-----Original Message-----
From: T. Onoma <transami / runbox.com>
To: ruby-core / ruby-lang.org <ruby-core / ruby-lang.org>
Sent: Sat Nov 15 17:47:05 2003
Subject: Re: open-uri patch, added progress_proc hook

given everything you've pointed out some shortcoimings ay be unavoidable if
it is to be very simple.

i think Elliott's suggestion is to offer a special class that can be used to
control the details, something like (not correct but you get idea)

  class OpenURI::ProgessProc
    def initialize(a, x, y)
      progress_proc = a
      show_progress_when_empty = x
      pass_parameters = y
    end
  end

so that

  progress = OpenURI::Progess.new(proc { |b,t| ... }, true, :pos, :total)
  open(url,progress)

or something like that. (and perhaps then proc could be passed as block
instead?)
but i don't know if i like this.

better i think just to have

  open(url, :progress_proc => {|p| ...})  # the default is :proc_when_empty
=> false
  open(url, :total_proc => {|t| ...}, :proc_when_empty => true )
  open(url, :progress_total_proc => {|p,t| ...}, :proc_when_empty => true )

-t0



*********************************************************************
This e-mail and any attachment is confidential. It may only be read, copied and used by the intended recipient(s). If you are not the intended recipient(s), you may not copy, use, distribute, forward, store or disclose this e-mail or any attachment. If you are not the intended recipient(s) or have otherwise received this e-mail in error, you should destroy it and any attachment and notify the sender by reply e-mail or send a message to sysadmin / bluearc.com
*********************************************************************