Class: Crowbar::Client::Request::Rest
- Inherits:
-
RestClient::Resource
- Object
- RestClient::Resource
- Crowbar::Client::Request::Rest
- Defined in:
- lib/crowbar/client/request/rest.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Rest
constructor
A new instance of Rest.
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 42 43 44 |
# File 'lib/crowbar/client/request/rest.rb', line 23 def initialize( = {}) url = .fetch(:url, "") user = .fetch(:user, Config.username) password = .fetch(:password, Config.password) auth_type = .fetch(:auth_type, :digest) verify_ssl = .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 |