Class: Wazuh::Configuration::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/wazuh/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



14
15
16
17
18
19
# File 'lib/wazuh/configuration.rb', line 14

def initialize
  @http_accept    = 'application/json'
  @user_agent     = "Wazuh.rb Ruby Gem #{Wazuh::VERSION}"
  @params_encoder = Faraday::FlatParamsEncoder
  @proxy          = nil
end

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def api_endpoint
  @api_endpoint
end

#ca_fileObject

Returns the value of attribute ca_file.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def ca_file
  @ca_file
end

#client_certObject

Returns the value of attribute client_cert.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def client_cert
  @client_cert
end

#client_keyObject

Returns the value of attribute client_key.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def client_key
  @client_key
end

#http_acceptObject

Returns the value of attribute http_accept.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def http_accept
  @http_accept
end

#params_encoderObject

Returns the value of attribute params_encoder.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def params_encoder
  @params_encoder
end

#proxyObject

Returns the value of attribute proxy.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def proxy
  @proxy
end

#requestObject

Returns the value of attribute request.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def request
  @request
end

#user_agentObject

Returns the value of attribute user_agent.



12
13
14
# File 'lib/wazuh/configuration.rb', line 12

def user_agent
  @user_agent
end

Instance Method Details

#http_request_headersObject



27
28
29
30
31
32
33
# File 'lib/wazuh/configuration.rb', line 27

def http_request_headers
  headers = {
    'Accept'     => http_accept,
    'User-Agent' => user_agent,
  }
  headers.select {|_, v| !!v}
end