Class: Spice::Connection

Inherits:
Object
  • Object
show all
Includes:
Authentication, Clients, Cookbooks, DataBags, Environments, Nodes, Roles, Search, Request
Defined in:
lib/spice/connection.rb,
lib/spice/connection/nodes.rb,
lib/spice/connection/roles.rb,
lib/spice/connection/search.rb,
lib/spice/connection/clients.rb,
lib/spice/connection/cookbooks.rb,
lib/spice/connection/data_bags.rb,
lib/spice/connection/environments.rb

Defined Under Namespace

Modules: Clients, Cookbooks, DataBags, Environments, Nodes, Roles, Search

Instance Method Summary collapse

Methods included from Authentication

#signature_headers

Methods included from Request

#delete, #get, #post, #put

Methods included from Search

#search

Methods included from Roles

#role, #roles

Methods included from Nodes

#create_node, #node, #nodes, #update_node

Methods included from Environments

#environment, #environments

Methods included from DataBags

#create_data_bag, #create_data_bag_item, #data_bag, #data_bag_item, #data_bags, #delete_data_bag_item, #update_data_bag_item

Methods included from Cookbooks

#cookbook, #cookbook_version, #cookbooks, #delete_cookbook_version

Methods included from Clients

#client, #clients, #create_client, #delete_client, #reregister_client, #update_client

Constructor Details

#initialize(attrs = Mash.new) ⇒ Connection

Returns a new instance of Connection.


43
44
45
46
47
48
49
50
51
52
53
# File 'lib/spice/connection.rb', line 43

def initialize(attrs=Mash.new)
  attrs = Spice.options.merge(attrs)

  unless attrs[:client_key].is_a?(OpenSSL::PKey::RSA)
    attrs[:client_key] = OpenSSL::PKey::RSA.new(attrs[:client_key])
  end
  
  Config::VALID_OPTIONS_KEYS.each do |key|
    instance_variable_set("@#{key}".to_sym, attrs[key])
  end
end

Instance Method Details

#sign_on_redirectObject

def initialize


55
56
57
# File 'lib/spice/connection.rb', line 55

def sign_on_redirect
  @sign_on_redirect ||= true
end

#sign_requestObject

def sign_on_redirect


59
60
61
# File 'lib/spice/connection.rb', line 59

def sign_request
  @sign_request ||= true
end