Sha256: e3c6b97acc4b0a8600169d5f8a8ca40e4b523fc1c0224b050665f078009fddac

Contents?: true

Size: 416 Bytes

Versions: 4

Compression:

Stored size: 416 Bytes

Contents

module Burglar
  ##
  # Collection of banks
  class Heist
    def initialize(params = {})
      @options = params
    end

    def banks
      @banks ||= @options[:banks].map do |k, v|
        [k, Burglar::Bank.new(@options.merge(v))]
      end.to_h
    end

    def transactions
      @transactions ||= Ledger.new(
        entries: banks.map { |_, v| v.transactions.entries }.flatten.sort
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
burglar-0.1.1 lib/burglar/heist.rb
burglar-0.1.0 lib/burglar/heist.rb
burglar-0.0.3 lib/burglar/heist.rb
burglar-0.0.2 lib/burglar/heist.rb