<commit_before># frozen_string_literal: true

module FinApps
  module REST
    class ScreeningMetadatas < FinAppsCore::REST::Resources # :nodoc:
      def show(id, key)
        not_blank(id, :session_id)
        not_blank(key, :key)

        path = "screenings/#{ERB::Util.url_encode(id)}/meta/#{ERB::Util.url_encode(key)}"
        super(nil, path)
      end

      def create(id, key, value)
        not_blank(id, :session_id)
        not_blank(key, :key)
        not_blank(value, :value)

        path = "screenings/#{ERB::Util.url_encode(id)}/meta"
        super({key => value}, path)
      end

      def destroy(id, key)
        not_blank(id, :session_id)
        not_blank(key, :key)

        path = "screenings/#{ERB::Util.url_encode(id)}/meta/#{ERB::Util.url_encode(key)}"
        super(nil, path)
      end
    end
  end
end<commit_msg>Fix bug in metadata body (#283)<commit_after># frozen_string_literal: true

module FinApps
  module REST
    class ScreeningMetadatas < FinAppsCore::REST::Resources # :nodoc:
      def show(id, key)
        not_blank(id, :session_id)
        not_blank(key, :key)

        path = "screenings/#{ERB::Util.url_encode(id)}/meta/#{ERB::Util.url_encode(key)}"
        super(nil, path)
      end

      def create(id, key, value)
        not_blank(id, :session_id)
        not_blank(key, :key)
        not_blank(value, :value)

        path = "screenings/#{ERB::Util.url_encode(id)}/meta"
        super({key: key, value: value}, path)
      end

      def destroy(id, key)
        not_blank(id, :session_id)
        not_blank(key, :key)

        path = "screenings/#{ERB::Util.url_encode(id)}/meta/#{ERB::Util.url_encode(key)}"
        super(nil, path)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.14318975552968569, 'fraction_numerical': 0.0017462165308498253, 'mean_word_length': 2.6809421841541754, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3939468', 'n_tokens_mistral': 627, 'n_tokens_neox': 606, 'n_words': 114}