Sha256: 14cdb9937044cbca99f7b8f7dee1c6bf202c29531283c7f1e6efd741fd5870aa

Contents?: true

Size: 627 Bytes

Versions: 8

Compression:

Stored size: 627 Bytes

Contents

module Dhis2
  module Api
    class CategoryCombo < Base
      class << self
        def defaut
          find_by(name: "default")
        end

        def create(client, combos)
          combos = [combos].flatten
          category_combo = {
            categoryCombos: combos.map do |combo|
              {
                name:                combo[:name],
                data_dimension_type: combo[:aggregation_type] || "DISAGGREGATION"
              }
            end
          }

          response = client.post("metadata", category_combo)
          Dhis2::Status.new(response)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dhis2-2.3.5 lib/dhis2/api/category_combo.rb
dhis2-2.3.4 lib/dhis2/api/category_combo.rb
dhis2-2.3.3 lib/dhis2/api/category_combo.rb
dhis2-2.3.2 lib/dhis2/api/category_combo.rb
dhis2-2.3.1 lib/dhis2/api/category_combo.rb
dhis2-2.2.1 lib/dhis2/api/category_combo.rb
dhis2-2.2.0 lib/dhis2/api/category_combo.rb
dhis2-2.1.0 lib/dhis2/api/category_combo.rb