Class: Crowbar::Client::Request::Rest

Inherits:
RestClient::Resource
  • Object
show all
Defined in:
lib/crowbar/client/request/rest.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Rest

Returns a new instance of Rest.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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)

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

  super(
    [
      Config.server,
      "/",
      url
    ].join(""),
    user: user,
    password: password,
    auth_type: auth_type
  )
end