lib/tfa/storage.rb in tfa-0.0.8 vs lib/tfa/storage.rb in tfa-0.0.9

- old
+ new

@@ -1,11 +1,19 @@ module TFA class Storage + include Enumerable + def initialize(filename:) @storage = PStore.new(File.join(Dir.home, ".#{filename}.pstore")) end - def all_secrets + def each + all.each do |each| + yield each + end + end + + def all open_readonly do |storage| storage.roots.map { |key| { key => storage[key] } } end end