Class: PuppetRestClient::DB::Connection

Inherits:
Object
  • Object
show all
Includes:
FactNames, Facts, Nodes, Resources, Request
Defined in:
lib/puppet-rest/db/connection.rb,
lib/puppet-rest/db/connection/facts.rb,
lib/puppet-rest/db/connection/nodes.rb,
lib/puppet-rest/db/connection/resources.rb,
lib/puppet-rest/db/connection/fact-names.rb

Defined Under Namespace

Modules: FactNames, Facts, Nodes, Resources

Instance Method Summary collapse

Methods included from Request

#api_path, #get

Methods included from Resources

#resources

Methods included from Facts

#facts

Methods included from FactNames

#fact_names

Methods included from Nodes

#node, #node_facts, #node_resources, #nodes

Constructor Details

#initialize(attrs = Mash.new) ⇒ Connection

Returns a new instance of Connection.



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

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

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

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