Class: Net::HTTP

Inherits:
Object
  • Object
show all
Defined in:
lib/restfulie/client/ext/http_ext.rb

Defined Under Namespace

Classes: Patch

Instance Method Summary collapse

Instance Method Details

#patch(path, data, initheader = nil, dest = nil, &block) ⇒ Object

Definition of a patch method in the same way that post works



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/restfulie/client/ext/http_ext.rb', line 5

def patch(path, data, initheader = nil, dest = nil, &block) # :yield: +body_segment+
  res = nil
  request(Patch.new(path, initheader), data) {|r|
    r.read_body dest, &block
    res = r
  }
  unless @newimpl
    res.value
    return res, res.body
  end
  res
end