Class: Puree::Extractor::Server

Inherits:
Object
  • Object
show all
Includes:
API::Authentication
Defined in:
lib/puree/extractor/server.rb

Overview

Server extractor.

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Server

Returns a new instance of Server.

Options Hash (config):

  • :url (String)

    The URL of the Pure host.

  • :username (String)

    The username of the Pure host account.

  • :password (String)

    The password of the Pure host account.



11
12
13
14
# File 'lib/puree/extractor/server.rb', line 11

def initialize(config)
  @resource_type = :server
  configure_api config
end

Instance Method Details

#getPuree::Model::Server? Also known as: find

Get server information.

Returns:



19
20
21
22
23
# File 'lib/puree/extractor/server.rb', line 19

def get
  raise 'Cannot perform a request without a configuration' if @config.nil?
  @response = @request.get resource_type: @resource_type
  set_content @response.body
end