Method: Yt::HTTPRequest#initialize
- Defined in:
- lib/yt/http_request.rb
#initialize(options = {}) ⇒ HTTPRequest
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes a Request object.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/yt/http_request.rb', line 33 def initialize( = {}) @method = .fetch :method, :get @host = .fetch :host, 'www.googleapis.com' @path = [:path] @params = .fetch :params, {} @headers = .fetch :headers, {} @body = [:body] @request_format = .fetch :request_format, :json @error_message = .fetch :error_message, ->(code) {"Error: #{code}"} end |