Class: RecordStore::Record::SSHFP

Inherits:
RecordStore::Record show all
Defined in:
lib/record_store/record/sshfp.rb

Defined Under Namespace

Modules: Algorithms, FingerprintTypes

Constant Summary collapse

FINGERPRINT_REGEX =
/\A[[:xdigit:]]+\z/

Constants inherited from RecordStore::Record

CNAME_REGEX, FQDN_REGEX

Instance Attribute Summary collapse

Attributes inherited from RecordStore::Record

#fqdn, #id, #ttl

Instance Method Summary collapse

Methods inherited from RecordStore::Record

#==, build_from_yaml_definition, ensure_ends_with_dot, ensure_ends_without_dot, escape, #hash, #key, #log!, long_quote, needs_long_quotes?, quote, #to_hash, #to_json, #to_s, #type, unescape, unlong_quote, unquote, #wildcard?

Constructor Details

#initialize(record) ⇒ SSHFP

Returns a new instance of SSHFP.



36
37
38
39
40
41
42
# File 'lib/record_store/record/sshfp.rb', line 36

def initialize(record)
  super

  @algorithm = record.fetch(:algorithm)
  @fptype = record.fetch(:fptype)
  @fingerprint = record.fetch(:fingerprint)
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



3
4
5
# File 'lib/record_store/record/sshfp.rb', line 3

def algorithm
  @algorithm
end

#fingerprintObject

Returns the value of attribute fingerprint.



3
4
5
# File 'lib/record_store/record/sshfp.rb', line 3

def fingerprint
  @fingerprint
end

#fptypeObject

Returns the value of attribute fptype.



3
4
5
# File 'lib/record_store/record/sshfp.rb', line 3

def fptype
  @fptype
end

Instance Method Details

#rdataObject



44
45
46
47
48
49
50
# File 'lib/record_store/record/sshfp.rb', line 44

def rdata
  {
    algorithm: algorithm,
    fingerprint: fingerprint,
    fptype: fptype,
  }
end

#rdata_txtObject



52
53
54
# File 'lib/record_store/record/sshfp.rb', line 52

def rdata_txt
  "#{algorithm} #{fptype} #{fingerprint}"
end