why do you need the full name for mechanize as so:
#!/usr/bin/ruby -w
require 'rubygems'
require 'pp'
require 'yaml'
require "mechanize"
yml = YAML.load_file 'login.yml'
user = yml["user"]
pword = yml["pword"]
a = WWW::Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
a.get('http://google.com/') do |page|
search_result = page.form_with(:name => 'f') do |search|
search.q = 'Hello world'
end.submit
search_result.links.each do |link|
puts link.text
end
end
when the mechanize example doesn't do that? This is asked on top of a previous question. Code only worked after reading the previous question on this exact topic and adding the full class(?) name. I've seem somewhat similar in Java, but only when it's ambiguous. Here, there's nothing ambigious, there's only the one Mechanize.
Pardon, the actual previous question completely contradicts the above link. The previous question I was referencing is here. To reiterate, two different questions, two different answers. Maybe the API or idiom changed.