Class: GPGME::UserID
- Inherits:
-
Object
- Object
- GPGME::UserID
- Defined in:
- lib/gpgme/user_id.rb,
lib/gpgme/ffi/user_id.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#signatures ⇒ Object
readonly
Returns the value of attribute signatures.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
-
#validity ⇒ Object
readonly
Returns the value of attribute validity.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
5 6 7 |
# File 'lib/gpgme/user_id.rb', line 5 def comment @comment end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
5 6 7 |
# File 'lib/gpgme/user_id.rb', line 5 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/gpgme/user_id.rb', line 5 def name @name end |
#signatures ⇒ Object (readonly)
Returns the value of attribute signatures.
5 6 7 |
# File 'lib/gpgme/user_id.rb', line 5 def signatures @signatures end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
5 6 7 |
# File 'lib/gpgme/user_id.rb', line 5 def uid @uid end |
#validity ⇒ Object (readonly)
Returns the value of attribute validity.
5 6 7 |
# File 'lib/gpgme/user_id.rb', line 5 def validity @validity 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 |
# File 'lib/gpgme/ffi/user_id.rb', line 3 def self.new_from_struct(struct) instance = allocate instance.instance_exec do @revoked = (struct[:flags] >> 0) & 1 @invalid = (struct[:flags] >> 1) & 1 @validity = struct[:validity] @uid = struct[:uid] @name = struct[:name] @email = struct[:email] @comment = struct[:comment] @signatures = [] pointer = struct[:signatures] until pointer.null? signature = Library::KeySig @signatures << KeySig.new_from_struct(signature) pointer = signature[:next] end end instance end |
Instance Method Details
#inspect ⇒ Object
15 16 17 18 |
# File 'lib/gpgme/user_id.rb', line 15 def inspect "#<#{self.class} #{name} <#{email}> \ validity=#{VALIDITY_NAMES[validity]}, signatures=#{signatures.inspect}>" end |
#invalid? ⇒ Boolean
11 12 13 |
# File 'lib/gpgme/user_id.rb', line 11 def invalid? @invalid == 1 end |
#revoked? ⇒ Boolean
7 8 9 |
# File 'lib/gpgme/user_id.rb', line 7 def revoked? @revoked == 1 end |