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.29.1 lib/decidim/map/utility.rb
decidim-core-0.28.4 lib/decidim/map/utility.rb
decidim-core-0.27.9 lib/decidim/map/utility.rb
decidim-core-0.29.0 lib/decidim/map/utility.rb
decidim-core-0.28.3 lib/decidim/map/utility.rb
decidim-core-0.27.8 lib/decidim/map/utility.rb
decidim-core-0.29.0.rc4 lib/decidim/map/utility.rb
decidim-core-0.29.0.rc3 lib/decidim/map/utility.rb
decidim-core-0.29.0.rc2 lib/decidim/map/utility.rb
decidim-core-0.29.0.rc1 lib/decidim/map/utility.rb
decidim-core-0.28.2 lib/decidim/map/utility.rb
decidim-core-0.27.7 lib/decidim/map/utility.rb
decidim-core-0.28.1 lib/decidim/map/utility.rb
decidim-core-0.27.6 lib/decidim/map/utility.rb
decidim-core-0.26.10 lib/decidim/map/utility.rb
decidim-core-0.26.9 lib/decidim/map/utility.rb
decidim-core-0.28.0 lib/decidim/map/utility.rb
decidim-core-0.27.5 lib/decidim/map/utility.rb
decidim-core-0.28.0.rc5 lib/decidim/map/utility.rb
decidim-core-0.28.0.rc4 lib/decidim/map/utility.rb