Sha256: 56835e4925db892b27b7f22b356d58e8e6df2b16b6258b969839f7dd30b752d9

Contents?: true

Size: 733 Bytes

Versions: 17

Compression:

Stored size: 733 Bytes

Contents

module RubyGPG2
  module StatusLines
    class Imported
      def self.parse(line)
        match = line.match(/^\[GNUPG:\] IMPORTED (.*?) (.*)$/)
        new(
            raw: line,
            key_id: match[1],
            user_id: match[2])
      end

      attr_reader(
          :raw,
          :key_id,
          :user_id)

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

      def type
        :imported
      end

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

      protected

      def state
        [
            @raw,
            @key_id,
            @user_id
        ]
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruby_gpg2-0.9.0.pre.6 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.9.0.pre.5 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.9.0.pre.4 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.9.0.pre.3 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.9.0.pre.2 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.9.0.pre.1 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.8.0 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.7.0.pre.1 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.6.0 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.5.0.pre.1 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.4.0 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.3.0.pre.2 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.3.0.pre.1 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.2.0 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.1.0.pre.27 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.1.0.pre.26 lib/ruby_gpg2/status_lines/imported.rb
ruby_gpg2-0.1.0.pre.25 lib/ruby_gpg2/status_lines/imported.rb