<commit_before>module Omniauth
  module Dsds
    class User
      attr_reader :uid, :email, :name, :roles, :organisation_uids

      def self.build_from(auth_hash)
        profile = auth_hash.fetch("profile")
        new(
          uid:   profile.fetch("uid"),
          name:  profile.fetch("name"),
          email: profile.fetch("email"),
          roles: auth_hash.fetch("roles"),
          organisation_uids: profile.fetch("organisation_uids")<commit_msg>Ensure that roles and organisation_ids are converted to an array from API response<commit_after>module Omniauth
  module Dsds
    class User
      attr_reader :uid, :email, :name, :roles, :organisation_uids

      def self.build_from(auth_hash)
        profile = auth_hash.fetch("profile")
        new(
          uid:   profile.fetch("uid"),
          name:  profile.fetch("name"),
          email: profile.fetch("email"),
          roles: Array(auth_hash.fetch("roles")),
          organisation_uids: Array(profile.fetch("organisation_uids"))
{'fraction_non_alphanumeric': 0.1156530408773679, 'fraction_numerical': 0.0, 'mean_word_length': 2.906614785992218, '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': '4306540', 'n_tokens_mistral': 297, 'n_tokens_neox': 299, 'n_words': 65}