Sha256: 89b51a9709fe6351b9b80f039ada73ebfcb4b8ae476b2054b6758b64af280ac3

Contents?: true

Size: 1.1 KB

Versions: 58

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module Decidim
  module Map
    # Generic map utility that will be used for providing different map
    # functionality to the application.
    #
    # @abstract
    class Utility
      attr_reader :organization, :configuration, :locale

      # Initializes the map utility.
      #
      # @param options [Hash] The options for the map utility
      # @option options [Decidim::Organization] :organization The organization
      #   where the map functionality is used
      # @option options [String] :config The configuration hash specific to the
      #   utility
      # @option options [String] :locale The locale to use for the queries
      def initialize(organization:, config:, locale: I18n.locale.to_s)
        @organization = organization
        @locale = locale
        configure!(config)
      end

      protected

      # Sets the local configurations for the utility.
      #
      # @param config [Hash] The whole configuration hash.
      #
      # @return [Hash] The configuration hash.
      def configure!(config)
        @configuration = config
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-core-0.25.0.rc4 lib/decidim/map/utility.rb
decidim-core-0.25.0.rc3 lib/decidim/map/utility.rb
decidim-core-0.25.0.rc2 lib/decidim/map/utility.rb
decidim-core-0.25.0.rc1 lib/decidim/map/utility.rb
decidim-core-0.24.3 lib/decidim/map/utility.rb
decidim-core-0.23.6 lib/decidim/map/utility.rb
decidim-core-0.24.2 lib/decidim/map/utility.rb
decidim-core-0.23.5 lib/decidim/map/utility.rb
decidim-core-0.24.1 lib/decidim/map/utility.rb
decidim-core-0.24.0 lib/decidim/map/utility.rb
decidim-core-0.24.0.rc2 lib/decidim/map/utility.rb
decidim-core-0.23.4 lib/decidim/map/utility.rb
decidim-core-0.24.0.rc1 lib/decidim/map/utility.rb
decidim-core-0.23.3 lib/decidim/map/utility.rb
decidim-core-0.23.2 lib/decidim/map/utility.rb
decidim-core-0.23.1 lib/decidim/map/utility.rb
decidim-core-0.23.1.rc1 lib/decidim/map/utility.rb
decidim-core-0.23.0 lib/decidim/map/utility.rb