Class: FentonShell::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/fenton_shell/key.rb

Overview

Provides SSH Key generation on the local client

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageString

Returns success or failure message and why.

Returns:

  • (String)

    success or failure message and why



6
7
8
# File 'lib/fenton_shell/key.rb', line 6

def message
  @message
end

Instance Method Details

#create(options) ⇒ String

Creates a new key on the local client

Parameters:

  • options (Hash)

    fields to send to ssh key pair generation

Returns:

  • (String)

    success or failure message



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fenton_shell/key.rb', line 13

def create(options)
  status, body = key_create(options)

  if status
    save_message('Key': ['created!'])
    true
  else
    save_message(body)
    false
  end
end