Sha256: 7b235b5d44f6fe0353d4f91b0fb26dc3d0b4cf56ce87a872337a0f6b8f2f2047

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

module ESA
  module ContextProviders
    class AccountContextProvider < ESA::ContextProvider
      def self.provided_types
        ["ESA::Contexts::AccountContext"]
      end

      def self.context_id(context, options = {})
        context.account_id
      end

      def self.contained_ids(context, options = {})
        context.amounts.uniq.pluck(:account_id)
      end

      def self.instantiate(parent, namespace, id, options = {})
        ESA::Contexts::AccountContext.new(chart_id: parent.chart_id, parent_id: parent.id, namespace: namespace, account_id: id)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
event_sourced_accounting-0.2.2 lib/esa/context_providers/account_context_provider.rb
event_sourced_accounting-0.1.6 lib/esa/context_providers/account_context_provider.rb