Sha256: adca55f8b830f046e998d94a5c821325f3c3fa6a6bc626e85deacfff076f766f
Contents?: true
Size: 653 Bytes
Versions: 2
Compression:
Stored size: 653 Bytes
Contents
require_relative 'persistence' module ArisControl class Bookkeeper attr_reader :persistence, :users def initialize(persistence = default_persistence) @persistence = persistence @users = persistence.load_users end def list users end def add(name:, email:, **opts) email or raise ArgumentError user = users[name] || {} users[name] = user.merge(opts).merge(email: email) persistence.store_users(users) end def delete(name) users.delete(name) persistence.store_users(users) end def default_persistence ArisControl::Persistence.new end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aris-control-1.1.1 | lib/aris-control/bookkeeper.rb |
aris-control-1.1.0 | lib/aris-control/bookkeeper.rb |