Skip to content

Support for more user-friendly enumerators #17

Description

@ribose-jeffreylau

Currently, given this:

rnp = Rnp.new

... the following enumerators are provided:

rnp.each_fingerprint
rnp.each_grip
rnp.each_keyid
rnp.each_userid

Would it be possible to have the following way of working with the rnp object?

rnp.each_key do |key|
  key # ... do something ...
end

or even:

rnp.keys # => returns the collection of all key objects

so one could do these:

rnp.keys
  .filter(&:primary?)
  .filter(&:protected?)
  .filter(&:secret_key_present?)
  .reject(&:expired?)

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions