Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
I don't get how the method is added in this case
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Cd Cd, post: 4573890"] But if I go something like #!/usr/bin/ruby -w require 'net/http' h=Net::HTTP.new('[URL="http://www.pragmaticprogrammer.com',80"]www.pragmaticprogrammer.com',80[/URL]) response=h.get('/index.html',nil) if(response.message=="OK") b = response.body p b end 'b' will print out the body of the web page. So 'b' in this case would be become the receiver (ie imgs = b.scan(/<img src="(.*?)"/m)), then we go from getting the value 'b' (via p b) to 'b' acting like a method (via imgs = b.scan(/<img src="(.*?)"/m))? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
I don't get how the method is added in this case
Top