class Crowbar::Client::Request::Rest

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method
# File lib/crowbar/client/request/rest.rb, line 23
def initialize(options = {})
  url = options.fetch(:url, "")
  user = options.fetch(:user, Config.username)
  password = options.fetch(:password, Config.password)
  auth_type = options.fetch(:auth_type, :digest)
  verify_ssl = options.fetch(:verify_ssl, Config.verify_ssl)

  Config.debug && RestClient.log = "stdout"

  super(
    [
      Config.server,
      "/",
      url
    ].join(""),
    user: URI::DEFAULT_PARSER.escape(user, URI::PATTERN::RESERVED),
    password: URI::DEFAULT_PARSER.escape(password, URI::PATTERN::RESERVED),
    auth_type: auth_type,
    verify_ssl: verify_ssl,
    timeout: Config.timeout
  )
end