| Class | Dnsruby::RR::SSHFP |
| In: |
lib/Dnsruby/resource/SSHFP.rb
|
| Parent: | RR |
| TypeValue | = | Types::SSHFP #:nodoc: all |
| alg | [RW] | |
| fp | [RW] | |
| fptype | [RW] |
# File lib/Dnsruby/resource/SSHFP.rb, line 43
43: def from_hash(hash)
44: if hash[:alg]
45: @alg = Algorithms.new(hash[:alg])
46: end
47: if hash[:fptype]
48: @fptype = FpTypes.new(hash[:fptype])
49: end
50: if hash[:fp]
51: @fp = hash[:fp]
52: end
53: end
# File lib/Dnsruby/resource/SSHFP.rb, line 55
55: def from_string(input)
56: if (input.length > 0)
57: names = input.split(" ")
58: begin
59: @alg = Algorithms.new(names[0].to_i)
60: rescue ArgumentError
61: @alg = Algorithms.new(names[0])
62: end
63: begin
64: @fptype = FpTypes.new(names[1].to_i)
65: rescue ArgumentError
66: @fptype = FpTypes.new(names[1])
67: end
68: @fp = [names[2]].pack("H*")
69: end
70: end