Class: PuppetRestClient::PE::Connection

Inherits:
Object
  • Object
show all
Includes:
CaCert, Catalog, Node, Request
Defined in:
lib/puppet-rest/pe/connection.rb,
lib/puppet-rest/pe/connection/node.rb,
lib/puppet-rest/pe/connection/ca_cert.rb,
lib/puppet-rest/pe/connection/catalog.rb

Defined Under Namespace

Modules: CaCert, Catalog, Node

Instance Method Summary collapse

Methods included from Request

#api_path, #get

Methods included from CaCert

#ca_cert

Methods included from Catalog

#catalog

Methods included from Node

#node

Constructor Details

#initialize(attrs = Mash.new) ⇒ Connection

Returns a new instance of Connection.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/puppet-rest/pe/connection.rb', line 12

def initialize(attrs=Mash.new)
  attrs = PuppetRestClient::PE.options.merge(attrs)

  #unless attrs[:client_key].is_a?(OpenSSL::PKey::RSA)
  #  attrs[:client_key] = OpenSSL::PKey::RSA.new(attrs[:client_key])
  #end

  PuppetRestClient::PE::Config::VALID_OPTIONS_KEYS.each do |key|
    instance_variable_set("@#{key}".to_sym, attrs[key])
  end
end