Class: RubyGPG2::StatusLines::ImportOK
- Inherits:
-
Object
- Object
- RubyGPG2::StatusLines::ImportOK
- Defined in:
- lib/ruby_gpg2/status_lines/import_ok.rb
Constant Summary collapse
- REASONS =
{ 1 => :new_key, 2 => :new_user_ids, 4 => :new_signatures, 8 => :new_subkeys, 16 => :private_key }
Instance Attribute Summary collapse
-
#key_fingerprint ⇒ Object
readonly
Returns the value of attribute key_fingerprint.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#reasons ⇒ Object
readonly
Returns the value of attribute reasons.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(opts) ⇒ ImportOK
constructor
A new instance of ImportOK.
- #type ⇒ Object
Constructor Details
#initialize(opts) ⇒ ImportOK
Returns a new instance of ImportOK.
25 26 27 28 29 |
# File 'lib/ruby_gpg2/status_lines/import_ok.rb', line 25 def initialize(opts) @raw = opts[:raw] @reasons = opts[:reasons] @key_fingerprint = opts[:key_fingerprint] end |
Instance Attribute Details
#key_fingerprint ⇒ Object (readonly)
Returns the value of attribute key_fingerprint.
20 21 22 |
# File 'lib/ruby_gpg2/status_lines/import_ok.rb', line 20 def key_fingerprint @key_fingerprint end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
20 21 22 |
# File 'lib/ruby_gpg2/status_lines/import_ok.rb', line 20 def raw @raw end |
#reasons ⇒ Object (readonly)
Returns the value of attribute reasons.
20 21 22 |
# File 'lib/ruby_gpg2/status_lines/import_ok.rb', line 20 def reasons @reasons end |
Class Method Details
.parse(line) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ruby_gpg2/status_lines/import_ok.rb', line 12 def self.parse(line) match = line.match(/^\[GNUPG:\] IMPORT_OK (\d+) (.*)$/) new( raw: line, reasons: reasons(match[1]), key_fingerprint: match[2]) end |
Instance Method Details
#==(other) ⇒ Object
35 36 37 |
# File 'lib/ruby_gpg2/status_lines/import_ok.rb', line 35 def ==(other) other.class == self.class && other.state == state end |
#type ⇒ Object
31 32 33 |
# File 'lib/ruby_gpg2/status_lines/import_ok.rb', line 31 def type :import_ok end |