Class: RubyGPG2::StatusLines::Imported
- Inherits:
-
Object
- Object
- RubyGPG2::StatusLines::Imported
- Defined in:
- lib/ruby_gpg2/status_lines/imported.rb
Instance Attribute Summary collapse
-
#key_id ⇒ Object
readonly
Returns the value of attribute key_id.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(opts) ⇒ Imported
constructor
A new instance of Imported.
- #type ⇒ Object
Constructor Details
#initialize(opts) ⇒ Imported
Returns a new instance of Imported.
17 18 19 20 21 |
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 17 def initialize(opts) @raw = opts[:raw] @key_id = opts[:key_id] @user_id = opts[:user_id] end |
Instance Attribute Details
#key_id ⇒ Object (readonly)
Returns the value of attribute key_id.
12 13 14 |
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 12 def key_id @key_id end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
12 13 14 |
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 12 def raw @raw end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
12 13 14 |
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 12 def user_id @user_id end |
Class Method Details
.parse(line) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 4 def self.parse(line) match = line.match(/^\[GNUPG:\] IMPORTED (.*?) (.*)$/) new( raw: line, key_id: match[1], user_id: match[2]) end |
Instance Method Details
#==(other) ⇒ Object
27 28 29 |
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 27 def ==(other) other.class == self.class && other.state == state end |
#type ⇒ Object
23 24 25 |
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 23 def type :imported end |