Object
Fake response for dealing with file:/// requests
# File lib/mechanize/file_response.rb, line 32 32: def [](key) 33: return nil unless key.downcase == 'content-type' 34: return 'text/html' if directory? 35: return 'text/html' if ['.html', '.xhtml'].any? { |extn| 36: @file_path =~ /#{extn}$/ 37: } 38: nil 39: end
# File lib/mechanize/file_response.rb, line 21 21: def code 22: ::File.exists?(@file_path) ? 200 : 400 23: end
# File lib/mechanize/file_response.rb, line 25 25: def content_length 26: return dir_body.length if directory? 27: ::File.exists?(@file_path) ? ::File.stat(@file_path).size : 0 28: end
# File lib/mechanize/file_response.rb, line 30 30: def each_header; end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.