lib/puppet/indirector/rest.rb
# Encapsulate call to request.do_request with the arguments from this class
# Then yield to the code block that was called in
# We certainly could have retained the full request.do_request(...) { |r| ... }
# but this makes the code much cleaner and we only then actually make the call
# to request.do_request from here, thus if we change what we pass or how we
# get it, we only need to change it here.
Encapsulate call to request.do_request with the arguments from this class
Then yield to the code block that was called in
We certainly could have retained the full request.do_request(...) { |r| ... }
but this makes the code much cleaner and we only then actually make the call
to request.do_request from here, thus if we change what we pass or how we
get it, we only need to change it here.
Encapsulate call to request . do_request with the arguments from this class Then yield to the code block that was called in We certainly could have retained the full request . do_request ( ... ) { |r| ... } but this makes the code much cleaner and we only then actually make the call to request . do_request from here thus if we change what we pass or how we get it we only need to change it here .
def do_request(request)
    response = request.do_request(self.class.srv_service, self.class.server, self.class.port) { |req| yield(req) }
    handle_response(request, response) if response
    response
  end
def do_request ( request ) response = request . do_request ( self . class . srv_service , self . class . server , self . class . port ) { | req | yield ( req ) } handle_response ( request , response ) if response response end
Encapsulate call to request.do_request with the arguments from this class
Then yield to the code block that was called in
We certainly could have retained the full request.do_request(...) { |r| ... }
but this makes the code much cleaner and we only then actually make the call
to request.do_request from here, thus if we change what we pass or how we
get it, we only need to change it here.
Encapsulate call to request . do_request with the arguments from this class Then yield to the code block that was called in We certainly could have retained the full request . do_request ( ... ) { |r| ... } but this makes the code much cleaner and we only then actually make the call to request . do_request from here thus if we change what we pass or how we get it we only need to change it here .
request