lib/burglar/heist.rb in burglar-0.1.4 vs lib/burglar/heist.rb in burglar-0.2.0
- old
+ new
@@ -11,12 +11,12 @@
def initialize(params = {})
@options = load_options(params)
end
def banks
- @banks ||= @options[:banks].map do |k, v|
- [k, Burglar::Bank.new(@options.merge(v))]
- end.to_h
+ @banks ||= @options[:banks].transform_values do |v|
+ Burglar::Bank.new(@options.merge(v))
+ end
end
def transactions
@transactions ||= Ledger.new(
entries: banks.map { |_, v| v.transactions.entries }.flatten.sort