Skip to content

Support for more user-friendly enumerators #17

@ribose-jeffreylau

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!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions