Submitting a URL with Mechanize

Hi,

I have a function called showURL, which prints out a URL when I do this:

puts master.showURL

Where master is an instance of the class URL, which I have previously
defined. showURL is a method defined in the URL class.

I am using Mechanize to get URLS, like this:

agent = Mechanize.new

and I want to try an submit the URL I have created, something like this:

agent.get(puts master.showURL)

This doesn’t seem to work.

Can anyone give me a hand?

Many thanks in advance.

Dwight

Does showURL returns the URL?

Patricio Bruna V.

(+56-9) 8899 6618

El 09-09-2011, a las 7:36, dwight schrute [email protected] escribió:

On Fri, Sep 9, 2011 at 5:38 AM, dwight schrute [email protected]
wrote:

Many thanks in advance.

Dwight


Posted via http://www.ruby-forum.com/.

puts sends the url to standard output. That isn’t what you want, you
want to
pass it to agent.get

agent.get(master.showURL)