Class: RubyGPG2::StatusLines::Imported

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_gpg2/status_lines/imported.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Imported

Returns a new instance of Imported.



21
22
23
24
25
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 21

def initialize(opts)
  @raw = opts[:raw]
  @key_id = opts[:key_id]
  @user_id = opts[:user_id]
end

Instance Attribute Details

#key_idObject (readonly)

Returns the value of attribute key_id.



15
16
17
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 15

def key_id
  @key_id
end

#rawObject (readonly)

Returns the value of attribute raw.



15
16
17
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 15

def raw
  @raw
end

#user_idObject (readonly)

Returns the value of attribute user_id.



15
16
17
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 15

def user_id
  @user_id
end

Class Method Details

.parse(line) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 6

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



31
32
33
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 31

def ==(other)
  other.class == self.class && other.state == state
end

#typeObject



27
28
29
# File 'lib/ruby_gpg2/status_lines/imported.rb', line 27

def type
  :imported
end