File: file_request.rb

package info (click to toggle)
ruby-mechanize 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,516 kB
  • sloc: ruby: 11,754; makefile: 7; sh: 2
file content (31 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true
##
# A wrapper for a file URI that makes a request that works like a
# Net::HTTPRequest

class Mechanize::FileRequest

  attr_accessor :uri

  def initialize uri
    @uri = uri
  end

  def add_field *a
  end

  alias []= add_field

  def path
    @uri.path
  end

  def each_header
  end

  def response_body_permitted?
    true
  end

end