Sha256: ec4b9565addbef5b4de3f7b4f2187dad781d7748810e5b09c534735ccf396941

Contents?: true

Size: 842 Bytes

Versions: 26

Compression:

Stored size: 842 Bytes

Contents

module Foobara
  module CommandConnectors
    module Transformers
      class LoadAggregatesPreCommitTransformer < Value::Transformer
        def applicable?(request)
          request.command.outcome.success?
        end

        def transform(request)
          load_aggregates(request.command.outcome.result)

          request
        end

        def load_aggregates(object)
          case object
          when Entity
            object.class.load_aggregate(object)
          when Array
            object.each do |element|
              load_aggregates(element)
            end
          when Hash
            object.each_key do |key|
              load_aggregates(key)
            end

            object.each_value do |value|
              load_aggregates(value)
            end
          end
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.25 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.24 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.23 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.22 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.21 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.20 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.19 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.18 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.17 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.16 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.15 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.14 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.13 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.12 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.11 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.10 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.9 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.8 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb
foobara-0.0.7 projects/command_connectors/src/transformers/load_aggregates_pre_commit_transformer.rb