<commit_before>require 'addressable/uri'

# This module builds URI objects for various endpoints of the POMS API
module Poms
  module Api
    # Contains modules that build uri objects for various api endpoints
    module URIs
      BASE_PARAMS = { scheme: 'https', host: 'rs.poms.omroep.nl' }.freeze

      # Builds uri's for /media endpoints
      module Media
        def self.single(mid)
          uri_for_path("/#{mid}")
        end

        def self.multiple
          uri_for_path('/multiple')
        end

        def self.descendants(mid)
          uri_for_path("/#{mid}/descendants")
        end

        def self.members(mid)
          uri_for_path("/#{mid}/members")
        end

        private

        def self.uri_for_path(path)
          Addressable::URI.new(BASE_PARAMS.merge(path: "/v1/api/media#{path}"))
        end
      end
    end
  end
end<commit_msg>Favour `module_function` over `def self`<commit_after>require 'addressable/uri'

# This module builds URI objects for various endpoints of the POMS API
module Poms
  module Api
    # Contains modules that build uri objects for various api endpoints
    module URIs
      BASE_PARAMS = { scheme: 'https', host: 'rs.poms.omroep.nl' }.freeze

      # Builds uri's for /media endpoints
      module Media
        module_function

        def single(mid)
          uri_for_path("/#{mid}")
        end

        def multiple
          uri_for_path('/multiple')
        end

        def descendants(mid)
          uri_for_path("/#{mid}/descendants")
        end

        def members(mid)
          uri_for_path("/#{mid}/members")
        end

        def uri_for_path(path)
          Addressable::URI.new(BASE_PARAMS.merge(path: "/v1/api/media#{path}"))
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0971590909090909, 'fraction_numerical': 0.0011363636363636363, 'mean_word_length': 2.1446428571428573, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1315981', 'n_tokens_mistral': 546, 'n_tokens_neox': 530, 'n_words': 141}