Class: SshHostKey::Fingerprint

Inherits:
Gitlab::SSHPublicKey show all
Defined in:
app/models/ssh_host_key.rb

Constant Summary

Constants inherited from Gitlab::SSHPublicKey

Gitlab::SSHPublicKey::TECHNOLOGIES

Instance Attribute Summary collapse

Attributes inherited from Gitlab::SSHPublicKey

#key, #key_text

Instance Method Summary collapse

Methods inherited from Gitlab::SSHPublicKey

#bits, sanitize, supported_sizes, technology, technology_for_key, #type, #valid?

Constructor Details

#initialize(key, index: nil) ⇒ Fingerprint

Returns a new instance of Fingerprint.


8
9
10
11
12
# File 'app/models/ssh_host_key.rb', line 8

def initialize(key, index: nil)
  super(key)

  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index


6
7
8
# File 'app/models/ssh_host_key.rb', line 6

def index
  @index
end

Instance Method Details

#as_jsonObject


14
15
16
# File 'app/models/ssh_host_key.rb', line 14

def as_json(*)
  { bits: bits, fingerprint: fingerprint, type: type, index: index }
end