Class: RubyGPG2::StatusLines::KeyConsidered
- Inherits:
-
Object
- Object
- RubyGPG2::StatusLines::KeyConsidered
- Defined in:
- lib/ruby_gpg2/status_lines/key_considered.rb
Constant Summary collapse
- FLAGS =
{ '0' => [], '1' => [:key_not_selected], '2' => [:all_subkeys_expired_or_revoked] }.freeze
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#key_fingerprint ⇒ Object
readonly
Returns the value of attribute key_fingerprint.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(opts) ⇒ KeyConsidered
constructor
A new instance of KeyConsidered.
- #type ⇒ Object
Constructor Details
#initialize(opts) ⇒ KeyConsidered
Returns a new instance of KeyConsidered.
27 28 29 30 31 |
# File 'lib/ruby_gpg2/status_lines/key_considered.rb', line 27 def initialize(opts) @raw = opts[:raw] @key_fingerprint = opts[:key_fingerprint] @flags = opts[:flags] end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
21 22 23 |
# File 'lib/ruby_gpg2/status_lines/key_considered.rb', line 21 def flags @flags end |
#key_fingerprint ⇒ Object (readonly)
Returns the value of attribute key_fingerprint.
21 22 23 |
# File 'lib/ruby_gpg2/status_lines/key_considered.rb', line 21 def key_fingerprint @key_fingerprint end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
21 22 23 |
# File 'lib/ruby_gpg2/status_lines/key_considered.rb', line 21 def raw @raw end |
Class Method Details
.parse(line) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ruby_gpg2/status_lines/key_considered.rb', line 12 def self.parse(line) match = line.match(/^\[GNUPG:\] KEY_CONSIDERED (.*) (.*)$/) new( raw: line, key_fingerprint: match[1], flags: FLAGS[match[2]] ) end |
Instance Method Details
#==(other) ⇒ Object
37 38 39 |
# File 'lib/ruby_gpg2/status_lines/key_considered.rb', line 37 def ==(other) other.class == self.class && other.state == state end |
#type ⇒ Object
33 34 35 |
# File 'lib/ruby_gpg2/status_lines/key_considered.rb', line 33 def type :key_considered end |