Class: RubyGPG2::StatusLines::ImportProblem
- Inherits:
-
Object
- Object
- RubyGPG2::StatusLines::ImportProblem
- Defined in:
- lib/ruby_gpg2/status_lines/import_problem.rb
Constant Summary collapse
- REASONS =
{ 0 => :no_reason_given, 1 => :invalid_certificate, 2 => :issuer_certificate_missing, 3 => :certificate_chain_too_long, 4 => :error_storing_certificate }
Instance Attribute Summary collapse
-
#key_fingerprint ⇒ Object
readonly
Returns the value of attribute key_fingerprint.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(opts) ⇒ ImportProblem
constructor
A new instance of ImportProblem.
- #type ⇒ Object
Constructor Details
#initialize(opts) ⇒ ImportProblem
Returns a new instance of ImportProblem.
25 26 27 28 29 |
# File 'lib/ruby_gpg2/status_lines/import_problem.rb', line 25 def initialize(opts) @raw = opts[:raw] @reason = opts[:reason] @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_problem.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_problem.rb', line 20 def raw @raw end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
20 21 22 |
# File 'lib/ruby_gpg2/status_lines/import_problem.rb', line 20 def reason @reason end |
Class Method Details
.parse(line) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ruby_gpg2/status_lines/import_problem.rb', line 12 def self.parse(line) match = line.match(/^\[GNUPG:\] IMPORT_PROBLEM (\d+) (.*)$/) new( raw: line, reason: REASONS[match[1].to_i], key_fingerprint: match[2]) end |
Instance Method Details
#==(other) ⇒ Object
35 36 37 |
# File 'lib/ruby_gpg2/status_lines/import_problem.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_problem.rb', line 31 def type :import_problem end |