Class: GPGME::SignResult

Inherits:
Object
  • Object
show all
Defined in:
lib/gpgme/misc.rb,
lib/gpgme/ffi/sign_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#invalid_signersObject (readonly)

Returns the value of attribute invalid_signers.



24
25
26
# File 'lib/gpgme/misc.rb', line 24

def invalid_signers
  @invalid_signers
end

#signaturesObject (readonly)

Returns the value of attribute signatures.



24
25
26
# File 'lib/gpgme/misc.rb', line 24

def signatures
  @signatures
end

Class Method Details

.new_from_struct(struct) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gpgme/ffi/sign_result.rb', line 3

def self.new_from_struct(struct)
  instance = allocate

  instance.instance_exec do
    @invalid_signers = []

    pointer = struct[:invalid_signers]
    until pointer.null?
      key = Library::InvalidKey.new pointer

      @invalid_signers << InvalidKey.new_from_struct(key)

      pointer = key[:next]
    end

    @signatures = []

    pointer = struct[:signatures]
    until pointer.null?
      signature = Library::NewSignature.new pointer

      @signatures << NewSignature.new_from_struct(signature)

      pointer = key[:next]
    end
  end

  instance
end