Sha256: c24b076cba9ff6b55c408ca56098dcad8de899e5feb2190870a3b9d1b648c6cd

Contents?: true

Size: 758 Bytes

Versions: 7

Compression:

Stored size: 758 Bytes

Contents

module Fog
  module Compute
    class DigitalOcean
      # noinspection RubyStringKeysInHashInspection
      class Real
        def delete_ssh_key(id)
          request(
            :expects => [204],
            :headers => {
              'Content-Type' => "application/json; charset=UTF-8",
            },
            :method  => 'DELETE',
            :path    => "/v2/account/keys/#{id}",
          )
        end
      end

      # noinspection RubyStringKeysInHashInspection
      class Mock
        def delete_ssh_key(id)
          self.data[:ssh_keys].select! do |key|
            key["id"] != id
          end

          response        = Excon::Response.new
          response.status = 204
          response
        end
      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
fog-digitalocean-0.4.0 lib/fog/compute/digitalocean/requests/delete_ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/requests/compute/delete_ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/requests/compute/delete_ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/requests/compute/delete_ssh_key.rb
fog-digitalocean-0.3.0 lib/fog/digitalocean/requests/compute/delete_ssh_key.rb
fog-digitalocean-0.2.0 lib/fog/digitalocean/requests/compute/delete_ssh_key.rb
fog-digitalocean-0.1.0 lib/fog/digitalocean/requests/compute/delete_ssh_key.rb